Activate environment with "source" or "conda"?

0 views
Skip to first unread message

Tom Loredo

unread,
Mar 19, 2018, 6:44:35 PM3/19/18
to conda - Public
Hi conda experts-

I've been puzzled about this for a while.  Sometimes, when I create a new conda env, I get the following instructions for activation:

To activate this environment, use:
> source activate py27env

To deactivate an active environment, use:
> source deactivate

Other times I get:

To activate this environment, use
 $ conda activate py36env

To deactivate an active environment, use
 $ conda deactivate

Note the use of "conda" instead of "source" (these examples also used two different Python versions).

The docs indicate that "source" is right:


That's what I've always used. Some students I teach (we use conda/anaconda in my course) instead use "conda" and seem to have no problem.

Is there a difference? Is there a reason the "conda create" command sometimes tells me to use "source" vs. "conda" for activation?

-Tom

Michael Sarahan

unread,
Mar 19, 2018, 7:17:39 PM3/19/18
to Tom Loredo, conda - Public
conda 4.4 added the new option.  Both should still work.  The new option is nice because it finally unifies the commands necessary between Windows and Linux/Mac.  It also removes the conflict with virtualenv, which also depended on a script named "activate."  It does require some setup, though, and I'm not sure exactly what the status on docs for that is.  I'd say give it a try - if it doesn't work, please file an issue on the conda github issue tracker and ask for the docs to be updated.

--
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/71f85ff1-e87e-4026-8878-301607d3fb56%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Wilfred Tyler Gee

unread,
Sep 14, 2018, 10:43:43 PM9/14/18
to conda - Public, lor...@astro.cornell.edu
The docs here are out of date and confusing. Any indication about when this change will make it into the docs? I'm left confused as to which way I should setup and activate environment.

Cheers!
Reply all
Reply to author
Forward
0 new messages