Software Resource - Fall 2020
  • Introduction
  • Anaconda
    • Getting started
    • Managing conda environments
      • Using Navigator
      • Using Terminal
      • Issues using zsh shell
    • Jupyter Notebook
  • Finite Element (FEniCS)
    • Getting started
    • Tutorial
  • Black Box (ML libraries)
    • Tensorflow
    • Pytorch
    • Scikit-learn
    • GPU acceleration
  • Version Control (Git)
    • Getting started
Powered by GitBook
On this page
  • Creating Environment
  • Managing Packages
  • Deactivating Environment
  • Deleting Environment

Was this helpful?

  1. Anaconda
  2. Managing conda environments

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.

PreviousUsing NavigatorNextIssues using zsh shell

Last updated 4 years ago

Was this helpful?

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.

$ conda create -name project1 python=3.7

If you are on MacOS and using the zsh shell, you may have problems using conda.

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.

$ conda activate project1

Managing Packages

We can easily add, upgrade, downgrade, and remove packages in the current environment with these commands.

# list of installed packages in environment
$ conda list
# add package: use conda install [package name]
$ conda install -c conda-forge tensorflow
# update to latest version: use conda update [package name]
$ conda update tensorflow
# if downgrading version, specify version during install
$ conda install tensorflow=1.1
# remove package: use conda remove [package name]
$ conda remove tensorflow

Deactivating Environment

$ conda deactivate

Deleting Environment

If you wish to delete the environment completely, navigate to the envs folder of your anaconda3 installation and remove the correct directory.

$ cd /Applications/anaconda3/envs
$ rm -r project1

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.

Using Anaconda with zsh ->
More info ->
More info ->