Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Python 3.3 (not 3.4) on OS X with Homebrew?

If you install python3 through Homebrew it installs the latest version by default, which I did. But I want 3.3 instead of 3.4. How can I replace it with 3.3 specifically using Homebrew? I want to try Django with Python 3 but I'm just learning Django so I want to use the latest stable version, currently 1.6, which is compatible with up to Python 3.3. I want to use it with Python 3, so it has to be 3.3. Django 1.7 is Py3.4 compatible but I don't want to mess with that 'til it's stable... on OS X 10.8.5

like image 252
user163831 Avatar asked Jul 15 '14 20:07

user163831


People also ask

How do I install a specific version of Python Mac?

Install Python 3 with the Official Installer First, download an installer package from the Python website. To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac.

How do I change Python from Python3 to OSX?

Open the terminal (bash or zsh) whatever shell you are using. Install python-3 using Homebrew (https://brew.sh). Look where it is installed. Change the default python symlink to the version you want to use from above.


1 Answers

Here are some elements that you can piece together from the homebrew FAQ.

  1. Can I edit formulae myself? - yes.

    brew edit python3
    
  2. look for the url and change it to the ftp link to the 3.3 (3.3.6) archive.

  3. download the archive locally and compute the checksum with shasum.

  4. save the file as python33.rb and install with brew install --debug python33.rb.

Passing the --debug flag will help you in case some steps are not working properly (e.g. in the latest formula, removing the 2to3 binary was a problem), you may just try to revert this change as python3.3 does not have ensurepip bootstrap module.

You can find the formula I used here: python 3.3.5

like image 163
dnozay Avatar answered Sep 25 '22 10:09

dnozay