gforsyth / xonda

DEPRECATED: (previously a thin wrapper around conda for xonsh)
BSD 3-Clause "New" or "Revised" License
11 stars 9 forks source link

Environment not found #10

Closed danmou closed 7 years ago

danmou commented 7 years ago

I can't activate any environments on my machine (Ubuntu 16.04):

$ conda info --envs
# conda environments:
#
py35                     /home/daniel/anaconda3/envs/py35
root                  *  /home/daniel/anaconda3

$ conda activate py35
No environment 'py35' found
gforsyth commented 7 years ago

Hey @Danmou -- thanks for reporting and sorry about that! Could you do the following, either in xonsh or a python repl?

from conda import config
print(config.envs_dirs)

thanks!

danmou commented 7 years ago

No problem! I get the following output: ('/home/daniel/.conda/envs', '/usr/envs')

I'm assuming this was supposed to include /home/daniel/anaconda3/envs?

gforsyth commented 7 years ago

That's what I would've expected. And certainly why it can't find your py35 environment. Now we just need to figure out how to set the envs_dirs...

gforsyth commented 7 years ago

Ok, so in your .condarc file (or create one if you don't have one) you can add the following:

envs_dirs:
  - /home/daniel/anaconda3/envs

and then it should work

danmou commented 7 years ago

Thanks, that fixed it. Although now py35 is listed twice when I do conda info --envs - any idea where it is getting the other one from? I have previously created, removed and recreated the environment so that might be the reason for the problems.

gforsyth commented 7 years ago

Maybe .conda/environments.txt? Also you should be able to type conda activate <TAB> and get a list of available environments from the tab completion.

danmou commented 7 years ago

environments.txt doesn't seem to affect it. Anyway it's not really a problem so I guess I'll just live with it. Thanks for the help!