2

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 (i.e. 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.

alex
  • 10,900
  • 15
  • 70
  • 100

1 Answers1

3

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
Stuart Berg
  • 17,026
  • 12
  • 67
  • 99
  • 1
    No kidding. I spent more time than I would like to admit trying to figure out why your simple example didn't work on my machine, either... I was inserting print statements into the conda code base, and even contemplating filing a bug with the conda repo. Then... oh, duh. I guess I was desperate to procrastinate on my real work. Lucky you. :-) – Stuart Berg May 16 '20 at 03:58