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.8create environment with python versionconda activate envNameactivate environment (orsource activate envNamein some operating systems)conda deactivatedeactivate environmentconda env listlist environments
Conda Package Commands: Install, Uninstall, List
conda install packageNameinstall package in current environmentconda install -c conda-forge packageNameinstall package in current environment from conda-forge channelconda listlist packages in current environmentconda uninstall packageNameuninstall package in current environment- `conda
Exporting & Importing Environments
conda install -c conda-forge --file requirements.txtinstall packages in current environment from conda-forge channel from requirements.txt fileconda env create -f environment.ymlcreate environment from yml fileconda env export > environment.ymlexport environment to yml filepip freeze > requirements.txtexport packages to requirements.txt file for pip installs
Other Conda Commands: Export, Create, Remove
conda env remove -n envNameremove environmentconda install -n envName packageNameinstall package in environmentconda install -n envName -c conda-forge packageNameinstall package in environment from conda-forge channelconda env export > environment.ymlexport environment to yml file
If you have any questions about this post or want to stay connected find me at:
Email Github Twitter LinkedIn