Search code examples
pipjupyter-notebookgoogle-colaboratory

difference between '%pip' and '!pip' in python jupyter notebook and colab


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?


Solution

  • %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.