Conda commands for managing environments
** This post is a “note”. I use notes to keep track of useful things for myself, but if you stumbled upon this page and find it useful, great!
Check out my blog posts for more in-depth content. **
Common Conda commands for managing environments
Conda is a package manager commonly used for python. It is used to create environments for different projects and to install packages in those environments. It is similar to virtualenv.
Conda Creating & Using Environment Commands: Create, Activate, Deactivate, List
conda create -n envName python=3.8
create environment with python versionconda activate envName
activate environment (orsource activate envName
in some operating systems)conda deactivate
deactivate environmentconda env list
list environments
Conda Package Commands: Install, Uninstall, List
conda install packageName
install package in current environmentconda install -c conda-forge packageName
install package in current environment from conda-forge channelconda list
list packages in current environmentconda uninstall packageName
uninstall package in current environment- `conda
Exporting & Importing Environments
conda install -c conda-forge --file requirements.txt
install packages in current environment from conda-forge channel from requirements.txt fileconda env create -f environment.yml
create environment from yml fileconda env export > environment.yml
export environment to yml filepip freeze > requirements.txt
export packages to requirements.txt file for pip installs
Other Conda Commands: Export, Create, Remove
conda env remove -n envName
remove environmentconda install -n envName packageName
install package in environmentconda install -n envName -c conda-forge packageName
install package in environment from conda-forge channelconda env export > environment.yml
export environment to yml file
If you have any questions about this post or want to stay connected find me at:
Email Github Twitter LinkedIn