Remove a Virtual Environment

The steps below will walk you through removing a virtual environment.


1. Open a Terminal.

If you're not already logged in, follow the steps found here. In the upper-right corner, click the New button and select Terminal.


2. List virtual environments

Run conda env list to see a list of virtual environments. Your output will look something like the following:


3. Remove the environment

Run conda env remove -n <environment_name>, substituting the name of the environment you would like to remove. For example:

conda env remove -n myVE

Press return when asked to proceed. The environment and all packages inside will be removed. Please be patient as this may take a few minutes.


4. Remove associated kernel

If you have an associated kernel, you should remove this as well. Jupyter kernels are located in .local/share/jupyter/kernels/. To remove them, cd to this directory and run rm -rf <kernel_name> to remove the associated kernel.

grahamhenke@bacon:~$ cd .local/share/jupyter/kernels/
grahamhenke@bacon:~/.local/share/jupyter/kernels$ ls
g27  ir  mykernel
grahamhenke@bacon:~/.local/share/jupyter/kernels$ rm -rf mykernel