CondaValueError: Value error: prefix already exists:

前端 未结 4 1695
北荒
北荒 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 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"
    

提交回复
热议问题