I have two Anaconda installations on my computer. The first one is based on Python 2.7 and the other is based on Python 3.4. The default Python version is the 3.4 though. What i
Virtualenv seems like the obvious answer here, but I do want to suggest an alternative that we've been using to great effect lately: Fig - this is particularly effective since we use Docker in production as well, but I imagine that using Fig as a replacement for virtualenv would be quite effective regardless of your production environment.
You don't need multiple anaconda
distributions for different python versions. I would suggest keeping only one.
conda
basically lets you create environments for your different needs.
conda create -n myenv python=3.3
creates a new environment named myenv
, which works with a python3.3 interpreter.
source activate myenv
switches to the newly created environment. This basically sets the PATH
such that pip
, conda
, python
and other binaries point to the correct environment and interpreter.
conda install pip
is the first thing you may want to do. Afterwards you can use pip
and conda
to install the packages you need.
After activating your environment pip install <mypackage>
will point to the right version of pip
so no need to worry too much.
You may want to create environments for different python versions or different sets of packages. Of course you can easily switch between those environments using source activate <environment name>
.
For more examples and details you may want to have a look at the docs.
Using virtualenv is your best option as @Dettorer has mentioned.
I found this method of installing and using virtualenv the most useful. Check it out:
Proper way to install virtualenv