Cheatography
https://cheatography.com
Common commands used in Conda package management
Creating environments
# By name only
conda create -n myenv
# By name and with packages
conda create -n myenv python=3.11 jinja2=3.1.4 wheel
# From file
conda env create -f environment.yml -n myenv
|
Activating/deactivating environments
Activate an environment:
conda activate myenv
Deactivate an environment:
conda deactivate
Switch to base environment (same as deactivating):
conda activate
|
Listing environments
conda info --envs
conda info -e
|
List packages in an environment
Export environment details
conda env export --no-builds --from-history
|
--no-builds means build numbers are not included (this is best practice).
--from-history means only explicitly installed packages are listed.
Add > environment.yml to the end to export the results to a file called environment.yml
(this will overwrite a file with the same name, if it exists).
Deleting an environment
conda remove -n myenv --all
|
|
|
Install packages into current environment
conda activate myenv
conda install matplotlib
|
Install specific package version
conda install numpy=1.11
conda install numpy==1.11
conda install "numpy>1.11"
conda install "numpy=1.11.1|1.11.3"
conda install "numpy>=1.8,<2"
|
Specify an environment to install packages in
conda install --name myenv matplotlib
|
Install packages based on file
conda env update -n my_env --file environment.yaml
|
Install package from non-default channel
conda install conda-forge::numpy
|
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets