How to: Install Multiple Versions of Python 3 on Mac

Was needing to test some code against multiple versions of Python 3. Namely: 3.2.x and 3.3.x and 3.4.x. Installing 3.5.x was easy using homebrew (brew install python3). But I couldn’t find brew packages for python3.2 and python3.3 and python3.4!

I ended up doing it the manual way, which wasn’t that hard.

  1. Download the installer from: https://www.python.org/downloads/mac-osx/
  2. Run the installer, I chose to do a “custom” install and only selected the command line tools (leaving out the docs and the GUI).
  3. Re-link your homebrew installation and fix permissions
~$ brew unlink python3 && brew link --overwrite python3
~$ sudo chown -R damon:admin /usr/local/bin

Now you should be set with python3.2, python3.3, python3.4 and python3 will run python3.4!

Note: this will cause a warning when using brew doctor that reads:

Warning: Python is installed at /Library/Frameworks/Python.framework
 
Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

So far I have been able to safely ignore this warning. That’s the location the Python installer writes to.

8 Comments (newest first)

  1. Anna Oliver says:

    Hello, i think that i noticed you visited my web site so i got here to “go back the want”.I am attempting to in finding things to improve my site!I guess its ok to use a few of your ideas!!

Start a new comment thread

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>