what is the difference between '!pip' and '%pip'? We can use both of them in jupyter notebook and google colab. But we can not use the simple 'pip' there, can we?
%pip
will install the package in the virtual environment where the current notebook kernel is running. While !pip
will install the package in the base environment. If you are using Python virtual environment (as you should!), you should use %pip
.