Python Common Issues
-
Do not install packages on the login nodes or inside a Jupyter Notebook. It has to be done in a terminal/shell:
$ interactive -t 30 -p htc$ ml mamba -
Avoid installing any packages in the
baseenvironment. If(base)shows in your prompt, deactivate this environment.(base) [rcsparky@login01:~]$(base) [rcsparky@login01:~]$ source deactivate[rcsparky@login01:~]$ -
Improper use of the
condacommands will inject some code into your~/.bashrcfile, which will cause problems. To remove these lines:$ remove_conda_from_bashrc$ source ~/.bashrc -
Running
pip installoutside of a mamba environment (or with--user) installs packages into~/.local/lib/python3*, which are then loaded by every Python environment and often break them. To check for such folders and disable them reversibly (see Deleting conflicting packages):$ cd ~/.local/lib$ ls$ mv python3.11 python3.11.old # repeat for each python3.* directory listed$ mamba clean --all -
How to remove an env safely:
$ interactive -t 60 -p htc$ module load mamba/latest$ mamba remove -n ENV_NAME --all$ mamba clean --all$ cd ~/.conda/envs$ ls$ rm -rf ENV_NAME