CondaValueError: Value error: prefix already exists:

前端 未结 4 1567
北荒
北荒 2021-02-13 14:27

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

相关标签:
4条回答
  • 2021-02-13 14:47

    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

    0 讨论(0)
  • 2021-02-13 14:48

    I simply deleted folder C:\Program Files\Miniconda2\envs\ENV1\.

    0 讨论(0)
  • 2021-02-13 15:06

    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"
    
    0 讨论(0)
  • 2021-02-13 15:09

    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.

    0 讨论(0)
提交回复
热议问题