Anaconda Environment
I’ve been using Continuum’s enterprise Python distribution package, Anaconda, for several months now and I love it. Recently, people have been asking about Python 2.7 vs Python 3.x and so I looked into how to switch between these environments using Anaconda.
In fact, it’s quite straightforward and painless with Anaconda.
To set up a new environment with Python 3.4:
Here, “py34” is a reference tag for later and “python=3.4 anaconda” are package specifications, which, according to the documentation, is the job of the SAT solver inside conda to find a consistent set of packages which satisfies these requirements. The above code will download all the new interpreter and all of the necessary dependencies to a separate directory.
To use (“activate”) the newly created environment:
Notice that we activate the reference tag “py34” that we chose above. Also, note that this new directory will be prepended to your path and the root Python directory will be removed (but Anaconda keeps track of all of this for you)
And to stop using (deactivate) the environment:
It’s that easy! When you call Python now, it should revert back to your root environment.
Obviously, you can remove or delete an environment at any time by doing:
Finally, to check what environments you have installed:
For more details, find the full set of features in the conda docs.