1

I used win10 64bit. The problem is that conda seems can not find env name, only env location.

*********************in system cmd*********************
#conda env list
# conda environments:
#
base                     C:\Users\czk\Anaconda3
py37                  *  C:\Users\czk\Anaconda3\envs\py37
testnumpy                C:\Users\czk\Anaconda3\envs\testnumpy

*********************in Cmder*********************
λ conda env list
# conda environments:
#
base                  *  C:\ProgramData\Anaconda3
                         C:\Users\czk\Anaconda3\envs\py37
                         C:\Users\czk\Anaconda3\envs\testnumpy
λ conda activate py37
Could not find conda environment: py37
You can list all discoverable environments with `conda info --envs`.

Above is the output in system cmd and Cmder. Also tried this answer, and without progress.

heLomaN
  • 1,634
  • 2
  • 22
  • 33

2 Answers2

2

I also try and failed your answer (also tried comments).

However, here is a workaround:

conda activate C:\Users\<YOUR_USER>\.conda\envs\<YOUR_ENV>
Greg7000
  • 297
  • 3
  • 15
1

You are using two different installations of anaconda, one in each tool ('system cmd' and 'Cmdr'). You can know this by seeing the path for the base environment is different from each. System cmd points to anaconda in your user folder (C:\Users\czk\Anaconda3), and Cmdr is pointing to the ProgramData folder (C:\ProgramData\Anaconda3).

Here's how you can ensure that all the environments can be activated by name, regardless which installation or console you're using:

  1. Create a .condarc file in your user home directory (if you haven't already).
  2. Add envs_dirs to it, like below. This tells conda where to look up environments by name. See docs on .condarc specification.
envs_dirs:
  - C:\ProgramData\Anaconda3\envs
  - C:\Users\czk\Anaconda3\envs
Scott H
  • 2,644
  • 1
  • 24
  • 28