0

I can't write (and therefore install packages) to the C:\Anaconda\envs\ folder, but even after changing the envs directories variable to point to a new path the activate command does not work.

enter image description here

Any suggestions? I looked at the activate.py script, but don't see an error message that matches mine or where to change the file path

Working in Windows-64. Not in powershell. Not sure how to manually edit my PATH. Already looked at Conda virtual envinment not changing under Windows - similar issue

I also didn't have success with this similar post: How to activate an Anaconda environment

The activate.bat file is what is generating the error at line 24, but I'm not sure how to fix it. Seems like the ANACONDA_ENVS is set in line 4, but I have no idea what ANACONDA_ENVS=%%~fi means

Community
  • 1
  • 1
user1946481
  • 35
  • 3
  • 11
  • Have you tried a space after `activate my_root `? – pylang Dec 20 '16 at 18:59
  • I tried that solution, but no luck :( – user1946481 Dec 20 '16 at 19:11
  • This is strange. Are you able to make a new test env, activate it and remove it? – pylang Dec 20 '16 at 19:27
  • conda does not know to look for an environment in c:\users\USERNAME\.conda\envs by default. See my answer below. – James Dec 20 '16 at 19:29
  • I haven't been able to make a test env that activates at all. I have done this on other laptops where I can access the C drive, but this is beyond me. I think it has to do with the activate file not connecting to the envs directories variable or something like that – user1946481 Dec 20 '16 at 19:55

4 Answers4

1

Try adding a new path variable to your .condarc file (NOTE: this assumes %USERPROFILE% is your C:\Users\USERNAME directory used above)

conda config --prepend envs_dirs %USERPROFILE%/.conda/envs

Close and reopen CMD and try

activate my_root
James
  • 32,991
  • 4
  • 47
  • 70
  • I gave it a go (with an added ':' after conda config) but the environment still didn't activate. The error message implies it is still looking in the C:\Anaconda\envs folder – user1946481 Dec 20 '16 at 19:43
0

Type:

activate C:\Users\N029810\.conda\envs\my_root

The prompt should change to:

(my_root)

Now, you should be able to install packages:

conda install <apackage>
Mike Müller
  • 82,630
  • 20
  • 166
  • 161
0

To solve this I modified the header of the activate.bat copy from "my_root\Scripts" folder and added fixed path:

 for /f "delims=" %%i in ("%~dp0..\envs") do (
    set ANACONDA_ENVS=C:\Users\yourusername\.conda\envs
)

This means that I had to execute in the prompt

C:\Users\yourusername\.conda\envs\Scripts\activate my_root

specifying the full path.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
0

copying the activate.bat file fixed it for me

user1946481
  • 35
  • 3
  • 11