Installing Python 3 Alongside Python 2 on OS X (Yosemite)

This was actually pretty easy. Here’s what I did:

  1. Opened a new Terminal window that wasn’t in a virtualenv.
  2. Ran brew update
  3. Ran brew install python3
  4. cd ~/.virtualenvs (the folder where my virtualenvs are)
  5. virtualenv -p `which python3` data3 to create a new virtualenv using Python 3
  6. workon data3 (this is from virtualenvwrapper)
  7. pip install "ipython[all]"

Update: I've been trying out pyenv, which is forked from my much-beloved rbenv. It seems to work fine with virtualenv via pyenv-virtualenv, but I could not get pyenv-virtualenvwrapper to work. I'm using this now to run an updated version of Python 2 without messing with my system Python, and it seems to work fine.


🌟 Was this page helpful? Please let me know with this quick, 3 question survey.