Skip to content

Instantly share code, notes, and snippets.

@phsteve
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phsteve/d75669e3dc1c363206b1 to your computer and use it in GitHub Desktop.
Save phsteve/d75669e3dc1c363206b1 to your computer and use it in GitHub Desktop.
Python and Pip installation with Homebrew

Python on Mac OS X

If you're writing Python:

Do which -a python to see how many Pythons you have installed.

If you see only /usr/bin/python, then you're good to go.

If not:

Delete any non-homebrew non-system pythons (these will be pythons you installed from python.org). Important note: You don't want to remove your system Python. It comes with Mac OS X and is installed by Apple in /System/Library. If you haven't installed a Python from python.org, there is no need to uninstall anything. Don't delete anything in /System/Library!
rm -rf /Applications/MacPython\ <VERSION> (might be Python instead of MacPython) Remove everything that comes up in ls -al /usr/local/bin | grep /Library/Frameworks/Python.framework for the version of Python you're uninstalling
rm -rf /Library/Frameworks/Python.framework This will kill all versions of python.org Python. You may want to only remove a specific one.
Look in your .bash_profile or .bashrc Remove anything that the python.org Python added to your $PATH

Now:
brew install python - includes pip, the python package manager
pip install virtualenv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment