Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Practical difference between pip and !pip [duplicate]

Tags:

python

pip

What is the purpose of the "!" in !pip? example !pip install tensorflow-gpu==2.0.0. While this seems to work I do not understand the use of the "!".

like image 428
user3344395 Avatar asked Mar 19 '26 23:03

user3344395


1 Answers

It means run it as a shell command rather than a notebook command

Try !ls or !pwd

It's the same as if you opened up a terminal and typed it without the !

It's very convenient and you can pass variables between the terminal and your notebook

like image 73
Marcus Weinberger Avatar answered Mar 22 '26 13:03

Marcus Weinberger