activating then deactivating an environment changes order of PATH

0 views
Skip to first unread message

Tyler Drobbin

unread,
Jul 12, 2016, 9:54:33 PM7/12/16
to conda - Public
Hello! when i activate an environment then deactivate it, the order of paths in my PATH variable changes. In particular the conda path moves from the end to the beginning:

Tylers-MacBook-Pro:lib tylerdrobbin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/tylerdrobbin/anaconda/bin

Tylers-MacBook-Pro:lib tylerdrobbin$ source activate main
discarding
/Users/tylerdrobbin/anaconda/bin from PATH
prepending
/Users/tylerdrobbin/anaconda/envs/main/bin to PATH

(main)Tylers-MacBook-Pro:lib tylerdrobbin$ echo $PATH
/Users/tylerdrobbin/anaconda/envs/main/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

(main)Tylers-MacBook-Pro:lib tylerdrobbin$ source deactivate
discarding /
Users/tylerdrobbin/anaconda/envs/main/bin from PATH

Tylers-MacBook-Pro:lib tylerdrobbin$ echo $PATH
/Users/tylerdrobbin/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin


If I run python now, it will run the conda distribution of python instead of my default system python.

Is there a way to ensure that the order in the original PATH is preserved after deactivating an environment? Thanks a lot!

Best,
Tyler

Tyler Drobbin

unread,
Jul 12, 2016, 9:57:48 PM7/12/16
to conda - Public
Also, I'm using OSX 10.11.5

Michael Sarahan

unread,
Jul 12, 2016, 10:11:49 PM7/12/16
to Tyler Drobbin, conda - Public
Strangely, this is one area where we do things better on Windows right now.  https://github.com/conda/conda/pull/2917 implemented this behavior and is in conda 4.1.6.  Our Conda tech lead wants to port that to the bash scripts, but hasn't had time yet.  Please raise an issue on the conda github repo.

--
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/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/692da6cb-129c-4cbd-b60b-2e797e1c1e1d%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Tyler Drobbin

unread,
Jul 12, 2016, 10:24:49 PM7/12/16
to Michael Sarahan, conda - Public
(+ reply all)

Got it. Now that you mention it - I use conda on windows at work and haven't noticed this happening there. I'll open an issue on github. Thanks!
Reply all
Reply to author
Forward
0 new messages