Using python scripts on Alma - python venv
Creating an environment with your installations will enable you to use python scripts on Alma in a reproducible manner. The environment can be shared with colleagues, help desk, and collaborators to ensure that the same environment is used for the same results. It also means that in the future you can recreate the environment to run the same scripts.
An alternative to conda/mamba is the python virtual environment. This is lighter and simpler than mamba, but not as powerful - it does not have the ability to also install some bioinformatics tools available on conda-forge but is limited to python libraries on pypi. Nevertheless, it is a good option for simple python scripts.
-
First get an interactive session:
-
Check the version of python
-
Create a new environment
-
Installing packages You can pip install the packages, optionally with version (=1.3.2).
-
Installing packages from a requirements file The packages can be listed in a simple text file - a requirements file. This can be installed with pip. This is an approximation of a reproducible environment but may not cover versions and dependencies.
-
Deactivate the environment
-
Remove the environment This is installed in the directory, so can be removed with
rm -rf my-env-name
.