March 7, 2025

How to Remove and Erase Anaconda and Conda Python Environments

In this tutorial, we explain how to remove and erase Anaconda and Conda Python virtual environments. It is a good practice to erase and remove Conda/Anaconda Python virtual environment if we are not using them. In that way, we can preserve the disk space. The challenge with Anaconda/Conda Python virtual environments is that the virtual environment files are not saved in the workspace folder in which the environment is created. The YouTube tutorial is given below.

How to Erase and Remove Conda and Anaconda Virtual Environments

Open a terminal and list the Conda environment

conda env list

The response is shown below.

# conda environments:
#
base                   /home/ahaber/anaconda3
ZonosEnv               /home/ahaber/anaconda3/envs/ZonosEnv
aloha                  /home/ahaber/anaconda3/envs/aloha
myenv                  /home/ahaber/anaconda3/envs/myenv
olmocr                 /home/ahaber/anaconda3/envs/olmocr
omni                   /home/ahaber/anaconda3/envs/omni

We can also list the Anaconda virtual environment by typing

conda info --envs

To erase the Anaconda environment, we need to use the following syntax

conda remove --name <name of the environment> --all

Let us erase the Python virtual environment called “olmocr”:

conda remove --name olmocr --all

This should erase the Conda virtual environment. Let us confirm that we have erased the environment by listing the environment once more

conda info --envs
# conda environments:
#
base                   /home/ahaber/anaconda3
ZonosEnv               /home/ahaber/anaconda3/envs/ZonosEnv
aloha                  /home/ahaber/anaconda3/envs/aloha
myenv                  /home/ahaber/anaconda3/envs/myenv
omni                   /home/ahaber/anaconda3/envs/omni

This confirms that the environment is erased.