简体   繁体   中英

Wrong env path in Conda

When I list my conda environments:

$ conda env list
# conda environments:
#
cardio4                  /home/username/.conda/envs/cardio4
minimal                  /home/username/.conda/envs/minimal
py2                      /home/username/.conda/envs/py2
py37                     /home/username/.conda/envs/py37
vmtk                  *  /home/username/.conda/envs/vmtk
base                     /opt/anaconda3

but when I try to install new environment:

$ conda create -n test python=3.7
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /opt/anaconda3/envs/test

Why is the default environment location not in my home.conda directory? This issue messes up some other stuff, like pip , which is not invoked from the correct location (ie my env location). Is there any PATH I can set to tell conda where my envs are?

This is confusing because conda activate actually does work and I can use these environments.

My .condarc :

env_dirs:
  - ~/.conda/envs
  - /opt/anaconda3/envs

/opt path is lower in list, yet it's somehow prioritized.

There is a typo in your .condarc file. The correct key name is envs_dirs (note both s characters). With that change, conda create should work as you expect.

envs_dirs:
  - ~/.conda/envs
  - /opt/anaconda3/envs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM