A faster version of conda, working with identical commands as described below, is mamba. We suggest to try this option.
To access a graphical interface to manage environment and launch utilities like jupyter:
anaconda-navigatorIf during the anaconda installation conda has not been activated:
source $HOME/anaconda3/bin/activateUpdate conda with:
conda update condaCreate a new environment with:
conda create --name env_name package_name
#example:
conda create --name snowflakes biopythonIt can require to install additional packages, dependencies required by your packages.
The environments can be activate and deactivate with:
conda activate env_name
conda activate #to go back to the base one
conda deactivateTo have the list of environments and paths:
conda info --envsYou can create environments with different versions of python:
conda create --name env_name python=2.7A specific version of python can also be specified in a second moment, all the installed packages will be adapted to the required version of python (if available).
To look if a package is installed:
conda search package_nameTo install it trough Anaconda repository:
conda install package_name
#pylab
conda install matplotlib
conda install scipyIf you want to see the list of installed packages:
conda listMove to the desired environment. Enter the local package folder, containing the setup.py file, then type:
pip install .If some local package is modified you will simply need to reinstall the same package to override the previous one.
conda env remove -n ENV_NAME
conda env remove --name ENV_NAMEThe environment.yml file has to specify details of the packages, the environment name and the python version required.
name: envname
channels:
- conda-forge
dependencies:
- python>=3.9,<3.11
- pyYAML
- xarray
- pip
- pip:
- sparse
- git+https://github.com/jhardenberg/smmregrid.git
In this example a range of python versions is specified and some custom package that requires a download from a git repository has been added.
conda env create -f environment.yml