The ASU Supercomputers offers a python-environment manager, mamba, which can help alleviate these issues by keeping python packages properly containedshould help improve the reliability of python installations and sidestep version conflicts.
This page describes the inner-workings of installing packages via various python methods (pip
and mamba install
) and the impacts it may havelocations it installs files to.
Info |
---|
The most common cause of Improper python package installation can result in Jupyter stopping working with “Bad State” is , as they introduce conflicts with user-installed python packages. See farther below for the fix. |
...
Environment Activated? | Installer | Command | Default Install Location | Note |
---|---|---|---|---|
No mamba/no env | pip | pip install package_name | /usr/local/lib/pythonX.X/site-packages | This location is not user-writable, so python may default to installing to your $HOME. Avoid this route. |
pip (with --user) | pip (with --user) | pip install --user package_name | ~/.local/lib/pythonX.X/site-packages | This location is user-writable, but installs packages in a location Jupyter Notebook/Lab uses on the Web Portal. Avoid this route. |
source activate YYYY | mamba | mamba install package_name | ~/.conda/envs/<envname>/lib/pythonX.X/site-packages | This location is user-writable and will be installed properly via mambas safeguards. PREFERRED route. |
source activate YYYY | pip | pip install package_name | ~/.conda/envs/<envname>/lib/pythonX.X/site-packages | This location is user-writable and will be installed properly via mambas safeguards. This is an ACCEPTABLE route for packages that cannot be installed via mamba. |
source activate YYYY | pip (with --user) | pip install --user package_name | ~/.local/lib/pythonX.X/site-packages | This location is user-writable, but installs packages in a location Jupyter Notebook/Lab uses on the Web Portal. Avoid this route. |
...