I am trying to clean up a few things now that I have Mavericks. I used Homebrew to install python 2.7 and 3.3. I also have their respective pips. Now I want to have a sane virtualenv setup.
I see from virtualenv with python2 and python3 via Homebrew that I can specify which version of python a newly-created virtualenv will use. What is the best (i.e., easiest to use/remember) way to make sure that a virtualenv using Python 3.3 uses pip3?
ETA: I've not had to use 3.3 before, so this is my first experience trying to maintain different versions. Sorry if this has an obvious answer.
Credit goes to scythargon for this one (left in a comment to Kristof's answer in this thread) and, since it did exactly what I needed, I figured it deserved its own answer.
When creating a virtualenv with virtualenvwrapper use the -p flag to explicitly associate it with a specific version of Python. In the examples below replace {virtualenv_name} with your intended virtual environment name:
Python 3.3:
$ mkvirtualenv {virtualenv_name} -ppython3.3
Python 3.4:
$ mkvirtualenv {virtualenv_name} -ppython3.4
Python 2.7:
$ mkvirtualenv {virtualenv_name} -ppython2.7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With