In Jupyter Notebook you can execute Terminal commands in the notebook cells by prepending an exclamation point/bang(!
) to the beginning of the command. This can be useful for many things such as getting information without having to open a Terminal/Command Prompt, or installing a conda package you are trying to use.
Example:
Importing a package that is not installed.
The above import failed because the package is not installed. You can use the exclamation/bang(!
) to run a conda install command. Be sure to provide "-y"
to specify yes to the install prompt as you can not submit input to the commands when running.
After the install has completed you can now import the package.
Any command that can be run from the Terminal(Linux, MacOS) or Command Prompt(Windows) can be executed this way. Another helpful command may be to get the conda info
of your installation.