10

I have installed Anaconda 2.2.0 for Windows and created a virtual environment via:

> conda create -n my-env anaconda

The environment is sucessfully created and I see it in my list of envinronments (and indeed the directory is there in Anaconda\envs..)

> conda info -e
# conda environments:
#
my-env                   D:\Anaconda\envs\my-env
root                  *  D:\Anaconda

However, when running the activate.bat script to switch envinronment, although it appears to be successful the switch isn't actually made:

> activate.bat my-env
Activating environment "astropy-dev"...
> conda list -e
# conda environments:
#
my-env                   D:\Anaconda\envs\my-env
root                  *  D:\Anaconda

With the * indicating the active environment.

I have seen some issues with conda activate on Windows but haven't found this sepecific issue.

For further info: I am looking to copy the whole Anaconda package distribution and then install a dev version over one package.

darthbith
  • 18,484
  • 9
  • 60
  • 76
Jdog
  • 10,071
  • 4
  • 25
  • 42

4 Answers4

15

If you are using Powershell, activate currently does not support it. You will need to modify your PATH manually, or else use the cmd shell.

asmeurer
  • 86,894
  • 26
  • 169
  • 240
  • Yep, works when using it in cmd shell. I had indeed tried in Powershell - couldn't see anywhere in the docs saying this didn't work though. I'm working under cygwin on Console where the behaviour in the original question is also seen, I'll just work around it for now. Thanks. – Jdog May 07 '15 at 18:17
1

Are you calling activate from within a batch script? Then it should be call activate my-env.

Wolfgang Ulmer
  • 3,450
  • 2
  • 21
  • 13
0

You don't need the .bat. It's just activate my-env.

Kerry
  • 1
  • Does omitting the ".bat" actually solve the problem though (and if so, why)? Or is it just a bit unnecessary but doesn't change anything (i.e. activate gets run whether you have it or not)? – DavidW Apr 26 '15 at 12:33
  • Yes, what DavidW said. This makes no difference whatsoever - the same script is being called regardless. – Jdog Apr 26 '15 at 17:05
0

You command

activate astropy-dev

must be run from the D:\Anaconda directory. Then it should work. To check, type:

conda info -e
dreab
  • 705
  • 3
  • 12
  • 22