Using Terminal
Alternatively, conda environments can managed using Terminal. In fact, everything on the GUI can be done with command lines. If you don't feel comfortable with this, you can use Anaconda Navigator.
Creating Environment
conda create
creates a new environment in the envs folder of your anaconda3 installation (for example, on my Mac, the location is /Applications/anaconda3/envs). We can additionally specify the python version when creating the environment.
If you are on MacOS and using the zsh shell, you may have problems using conda. Using Anaconda with zsh ->
An environment is activated by calling conda activate
with its name. Any scripts we run while the environment is activated will use the packages & versions installed within that environment.
Managing Packages
We can easily add, upgrade, downgrade, and remove packages in the current environment with these commands. More info ->
Deactivating Environment
To deactivate the conda environment, use conda deactivate
. Note that you do not need to activate the environment to manage packages: if an environment is deactivated, you can specify the environment name with the commands. More info ->
Deleting Environment
If you wish to delete the environment completely, navigate to the envs folder of your anaconda3 installation and remove the correct directory.
Last updated