Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda how do I activate environments

Tags:

I am struggling to activate conda environments I have created on mac os x. Here are the environment that I have created.

$: conda env list
# conda environments:
#
py34                     /Students/rt12083/anaconda3/envs/py34
py35                     /Students/rt12083/anaconda3/envs/py35
root                  *  /Students/rt12083/anaconda3

When I try to activate them I get the following error:

$: source activate py34
activate: No such file or directory.

When i run the command which activate I get the following:

which activate
/Students/rt12083/anaconda3/bin/activate

my path variable is:

garnet: echo $PATH

/sw/bin:/sw/sbin:.:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/    Developer/Tools:/usr/local/GMT4.5.7/bin:/usr/local/TauP/bin:/usr/local/SU/bin:/usr/local/sac/bin:/usr/local/sac/iaspei:/usr/local/sac/macros:/Students/rt12083/anaconda3/bin

What do I need to do to activate the environments?

like image 879
orgelzyklus Avatar asked Feb 25 '16 14:02

orgelzyklus


People also ask

How do you activate and deactivate a conda environment?

You can always use conda activate or conda deactivate to switch between your environments. You can directly activate the environment you wish to use by using conda activate . conda deactivate will deactivate your current active environment and change to the default environment which is the base environment.

Do you have to activate conda environment every time?

Question 1: do i have to activate the conda env every time i open command prompt? No, you do not have to activate conda every time you open CMD. This is simply a matter of choice for the developer.

What does it mean to have conda activated?

With conda, you can create, export, list, remove, and update environments that have different versions of Python and/or packages installed in them. Switching or moving between environments is called activating the environment. You can also share an environment file.

What is the difference between conda activate and source activate?

Generally, you won't find too much of a difference between conda activate and the old source activate , except that it's meant to be faster, and work the same across different operating systems (the latter difference makes conda activate a huge improvement IMO).


Video Answer


1 Answers

Your path seems to be missing the root anaconda directory. when i echo $Path (where username is replacing my actual username) i have the following:

/Users/username/anaconda/bin:/Users/username/anaconda/bin:/Users/username/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

in my bash_profile (or zshrc file etc...) I added:

export PATH="/Users/username/anaconda/bin:$PATH"

I use iterm2 with zsh, although this probably applies to more general cases.

On OSX Sierra with Anaconda3 4.4.0 the path is now:

export PATH="/anaconda/bin:$PATH"

like image 111
ingrid Avatar answered Oct 20 '22 16:10

ingrid