#Jupyter ! symbol

3 messages · Page 1 of 1 (latest)

gleaming swallow
#

Hello,

Does the ! symbol in code, like !pip install execute a terminal command in the currently working directory or globally?

For example:
!pip install numpy, is it equivalent to opening up terminal in your currently workoing directory and typing pip install numpy?

Thanks!

livid tinsel
#

In Jupyter or Colab, !pip install numpy executes globally within the Python environment running the notebook. It’s equivalent to typing pip install numpy in a terminal linked to that environment. Commands use the notebook’s current working directory for relative paths. Use 'sys.executable ' for precision on package installations.

gleaming swallow
#

I see, thank you for clearing up my confusion!