2

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?

1 Answers1

1

%pip is a magic function and works mostly the same like pip. You can use other magic functions in jupyter which you can list with %lsmagic

(https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-lsmagic)

Using ! allows to run commands like ls or pip or what you have available on your OS.

Colab is just like jupyter so you can run native pip like pip install tensorflow.

See related answers:

x4k3p
  • 1,261
  • 2
  • 21
  • 39