Apple - keeping python 3 up to date on a mac

I personally use Homebrew, which is a very nice package manager. If you want to give this a try, first of all make sure you have the XCode Command Line Tools installed on your Mac. Then install Homebrew by typing

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

in the Terminal. Homebrew will place its "Cellar" (the set of all the packages you installed with Homebrew) in /usr/local/Cellar.

Now, about Python 3, once Homebrew is installed simply type

brew install python3

and there we go. You have Python3 installed on your Mac.

Notes:

  • this version will automatically take place instead of the OS X version (if it doesn't, just run brew link python3 - this will symlink python3 into /usr/local/bin/)
  • to update python run brew update in the Terminal (this will update Homebrew) and then brew upgrade python3 if a new version of python3 is found by the command brew update
  • at the end you can run brew cleanup python3 to remove every old version
  • with this fancy package manager, you can also take care of R

Use Homebrew :)

brew install python3

Hombrew installs everything into /usr/local/Cellar and creates symbolic links for applications in /usr/local/bin. It will not touch anything else in the system. It comes with the brew cleanup command, which removes unused or outdated applications automatically.

To update it:

brew update
brew upgrade python3

It will automatically link to the newest version after an upgrade and brew clean removes any remains of the previous version.


You can use the Anaconda distribution. Its a free version of Python 3 (and Python2). The Andaconda package will also let you update different python versions and upon installation it sets the proper python path. Anaconda comes with Anaconda Navigator which helps you load python packages and comes also with Spyder 3. A Python IDE type of app.

Tags:

Python