Saved environment variables on Windows

0 views
Skip to first unread message

Toke Jepsen

unread,
May 19, 2016, 1:59:50 PM5/19/16
to conda - Public
Hey,

Is it possible to have saved environment variable on windows, similar to how its described in the docs; http://conda.pydata.org/docs/using/envs.html#saved-environment-variables

Ray Donnelly

unread,
May 19, 2016, 2:02:45 PM5/19/16
to Toke Jepsen, conda - Public
Yeah, follow the instructions but use a batch file instead (extension
of .bat and use SET to set the variables) and it should work just the
same.

>
> --
> You received this message because you are subscribed to the Google Groups
> "conda - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to conda+un...@continuum.io.
> To post to this group, send email to co...@continuum.io.
> Visit this group at https://groups.google.com/a/continuum.io/group/conda/.

Toke Jepsen

unread,
May 19, 2016, 3:09:22 PM5/19/16
to Ray Donnelly, conda - Public

Got a batch script in miniconda\envs\test\etc\conda\activate.d\env_vars.bat with this set MY_KEY=secret_key and miniconda\envs\test\etc\conda\deactivate.d\env_vars.bat with this set MY_KEY=.
Activated the environment and called echo %MY_KEY%, but I don’t get the value.


Sincerely,

Toke Jepsen

18 Cumrae Street

Splott

CF24 2AJ

Cardiff, UK


Telephone No.: 00447527428225

www.bumpybox.com

Ray Donnelly

unread,
May 19, 2016, 3:13:13 PM5/19/16
to Toke Jepsen, conda - Public
Which version of conda are you using?

Toke Jepsen

unread,
May 19, 2016, 3:37:51 PM5/19/16
to Ray Donnelly, conda - Public

Sorry I’ve noticed the code is in the activate.bat. I think the problem is how I’m setting the environment for conda;

set PATH=%~dp0miniconda;%~dp0miniconda\Scripts

What else needs to be set for conda to be fully functional?


Sincerely,

Toke Jepsen

18 Cumrae Street

Splott

CF24 2AJ

Cardiff, UK


Telephone No.: 00447527428225

www.bumpybox.com


Ray Donnelly

unread,
May 19, 2016, 4:22:48 PM5/19/16
to Toke Jepsen, conda - Public
Your batch file should contain simply:

%~dpminiconda\Scripts\activate.bat test

Let me know if that works.

Ray Donnelly

unread,
May 19, 2016, 4:23:49 PM5/19/16
to Toke Jepsen, conda - Public
Gah, I missed a character, I meant:

%~dp0miniconda\Scripts\activate.bat test

Toke Jepsen

unread,
May 19, 2016, 5:05:14 PM5/19/16
to Ray Donnelly, conda - Public

Thanks for that, Ray :)

I can see the batch scripts being executed by having echo "Setting Environment" in the activate script, but the environments don’t get set for some reason.

I’ve tested the batch script outside of conda, and the environment variables get set so there shouldn’t be any problem with the batch script themselves.


Sincerely,

Toke Jepsen

18 Cumrae Street

Splott

CF24 2AJ

Cardiff, UK


Telephone No.: 00447527428225

www.bumpybox.com


Ray Donnelly

unread,
May 19, 2016, 5:11:19 PM5/19/16
to Toke Jepsen, conda - Public
I'm running out of ideas. If it printed the text and you don't have setlocal in your batch file the it should be fine. Which version of conda are you using? Try the latest from the conda channel (conda update conda conda-env -c conda should do it).

Ray Donnelly

unread,
May 19, 2016, 5:40:15 PM5/19/16
to Toke Jepsen, conda - Public
Please try with the latest which is 4.1.0rc3, to get it:

conda update conda conda-env -c conda

Toke Jepsen

unread,
May 19, 2016, 5:52:45 PM5/19/16
to Ray Donnelly, conda - Public
Running that only gets me updated to 4.0.6. Guessing it wouldn't have anything to do with installing conda with Miniconda?

Sincerely,

Toke Jepsen

18 Cumrae Street

Splott

CF24 2AJ

Cardiff, UK


Telephone No.: 00447527428225

www.bumpybox.com


Ray Donnelly

unread,
May 19, 2016, 6:32:10 PM5/19/16
to Toke Jepsen, conda - Public
Miniconda is fine, that's what I use. I think the win-64 version of 4.1.0rc3 hasn't been built yet. I'll reply when I know more.

Michael Sarahan

unread,
May 19, 2016, 7:53:00 PM5/19/16
to Ray Donnelly, Toke Jepsen, conda - Public

This is something that got fixed recently. Conda 4.1 is probably necessary.

Toke Jepsen

unread,
May 21, 2016, 8:37:04 AM5/21/16
to Michael Sarahan, Ray Donnelly, conda - Public
Any ETA on getting a 4.1 release?
Reply all
Reply to author
Forward
0 new messages