Reference:
https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/
I\'ve run the following commands to install conda and create a virtual env
The next time you open the terminal and the prompt is (base) C:\Users\whatever> Just type: (base) C:\Users\whatever> conda activate ENV1
Your prompt should change to: (ENV1) C:\Users\whatever>
And once your work is done just say: (ENV1) C:\Users\whatever> conda deactivate
Because it's obviously inconvenient to keep deleting the folder over and over
I simply deleted folder C:\Program Files\Miniconda2\envs\ENV1\
.
When the conda environment was previously removed, but the actual directory still exists (for some reason), then the "conda env remove -n ENV1" will do nothing:
$ conda-env list
# conda environments:
#
base * /home/nmanos/miniconda
test-env /home/nmanos/miniconda/envs/test-env
$ conda-env remove -n ENV1
# Nothing was removed (exit code zero)
$ ls /home/nmanos/miniconda/envs/ENV1
bin conda-meta etc go
# Directory still exists
So you can remove the actual ENV1 directory, as follow:
$ ENV_BASE=$(conda-env list | awk '/base/ { print $NF }')
$ echo $ENV_BASE
/home/nmanos/miniconda
$ rm -rf "$ENV_BASE/envs/ENV1"
You can overwrite the existing enviroment by adding the --force
option.
So:
conda create -n ENV1 python=2.7.12 anaconda --force
Make sure that you have updated you anaconda because it is a recent function.