Conda
tool
CLI
package manager
virtual environments
Conda is a package and virtual environment manager.
Installation
Installation via UNIX CLI
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
List, create and delete environments
- List your existing environments
-
conda env list
- Create environment
-
conda create --name env-name
- Create a conda env from a file:
-
conda env create -f environment.yml
- Removing / Deleting environment
-
conda env remove -n env-name
More info: Intro to Conda virtual environments
Use and manipulate environment
- Use environment
-
conda activate env-name
- Check and update package versions. After activating an env:
-
python --version
conda update python
- Update whole environment according to your yaml-file:
-
conda env update -f my_env.yml
- Switch back to base environment
-
conda deactivate env-name
- Install package: Latest version
-
conda install pandas
- Install package: Specific version
-
conda install pandas==2.0.0
- Install package: From different channel
-
conda install pandas -c conda-forge -y
- List packages in environment
-
conda list
- Export environment to yml
-
conda env export > environment.yml