Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source activate does not do anything

When I try to activate my environment (which has worked before), nothing happens. Is the only way to fix this is reinstalling everything? I have tried changing environment variables etc, but nothing works.

image

like image 921
Keiran Paster Avatar asked Jan 30 '17 22:01

Keiran Paster


1 Answers

You can have more clues with conda info --envs

Environments are installed by default into the envs directory in your conda directory.

Note: In Windows it is good practice to deactivate one environment before activating another.

If source activate does not set the environment variables properly, you can set them manually

See also troubleshooting:

Reactivate the environment or run hash -r (in bash) or rehash (in zsh)

When you run source activate, conda automatically runs hash -r in bash and rehash in zsh to clear the hashed commands, so conda will find things in the new path on the PATH.

This is a relatively rare problem, since this will only happen if you activate an environment or use the root environment, run a command from somewhere else, then conda install a program and try to run the program again without running source activate or source deactivate.

The command type command_name will always tell you exactly what is being run (this is better than which command_name, which ignores hashed commands and searches the PATH directly), and hash -r (in bash) or rehash (in zsh) will reset the hash, or you can run source activate.


Finally, note there are issues with Cygwin or MsysGit bash:

  • issue 3352: Cygwin activate works incorrectly
  • issue 1429: Windows Msysgit Bash shell cannot run conda's activate.bat
like image 78
VonC Avatar answered Jan 02 '23 05:01

VonC