Issue
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
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:
- What is the meaning of exclamation and question marks in Jupyter notebook?
- What is %pylab?
- How do I install Python packages in Google's Colab?
Answered By - x4k3p
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.