The first syntax (!
) is correct for running arbitrary shell commands in IPython.
However, it looks like the system python is being used, e.g. /usr/bin/python
which generally is not what one should use for interactive computing (or at least interactive package management), as this can leave a linux system in an unusable state. Using !apt
is… fine, but generally is a non-portable solution (e.g. to any other linux distribution, much less operating system).
It is generally recommended to create a secondary python environment to hold Jupyter-related tools, managed:
2 Likes