Brew Python 2



TutorialPython

I missed the memo, but back in January Homebrew announced that as of version 1.5, python would be upgraded to use Python 3.x. This change went live on March 1, and I noticed it over the weekend while tinkering with Homebridge.

Brew install python2.6. GitHub Gist: instantly share code, notes, and snippets. The python2 version is Python2.7.16 and Python3 version is Python3.6.8. Install Pip with easyinstall On MacOS easyinstall is a Python module bundled with setuptools which gives us the ability to download, build, install, and manage Python packages. Before pip easyinstall was the standard package manager for the Python.

While I was rebuilding Homebridge with the latest version of Node.js, I kept banging into node-gyp errors having to do with using Python 3.x. I’m not alone, though there is already a pull request to fix this issue.

Python

For the time being, I’ve made two changes to please node-gyp:

Brew python 2.7.17Brew python 2 and 3
  1. Forced a link of the new python@2 keg1:

  2. Added the following to my ~/.bash_profile, so that python will point at python2:

Brew Python 2 Tutorial

I think I’ll revert the second change once the node-gyp issue is resolved, to begin forcing myself to use Python 3.x.

Brew Python@2 Not Found

  1. This puts python2 into /usr/local/bin/, effectively adding it to my path. ↩