Updating Python library with HomeBrew could be a painful experience. Upgrading setuptools and pip may cause version disruption and will render pip and easy_install useless.
Here's a list of commands for the install process, FYI.
# disable virtualenv before doing this
umask 022
brew update
brew upgrade
cd /usr/local/lib/python2.7/site-packages
/bin/rm -rf pip*
/bin/rm -rf easy_install.pth
brew rm python && brew install python
pip install --upgrade setuptools
pip install --upgrade pip
# NOTE: edit pip version number manually
vim -X /usr/local/bin/pip
# NOTE: edit setuptools version number manually
vim -X /usr/local/bin/easy_install
# check whether pip and easy_install work
pip
easy_install
# check installed library versions
pip freeze
# without doing this virtualenvwrapper and stevedore libs will not be installed
export LC_CTYPE="C"
# install virtualenvwrapper
pip uninstall virtualenvwrapper
pip uninstall virtualenv-clone
pip uninstall virtualenv
pip uninstall stevedore
pip install stevedore
pip install virtualenv
pip install virtualenv-clone
pip install virtualenvwrapper
# install sphinx
easy_install sphinx
# install Pillow too
easy_install Pillow
# check Sphinx and Pillow version
pip freeze
# check if Sphinx really works
sphinx-quickstart
This is a copy of /usr/local/bin/pip
. You need to manually fix the version numbers as in pip==1.5.5
, with the latest pip version number installed in /usr/local/lib/python2.7/site-packages
.
You also have to do this for /usr/local/bin/easy_install
: the version number here is setuptools==3.6
(note well the name difference).
I think this is lame and disappointing, but this is the easiest way to fix things.
#!/usr/local/opt/python/bin/python2.7
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.5.5','console_scripts','pip'
__requires__ = 'pip==1.5.5'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('pip==1.5.5', 'console_scripts', 'pip')()
)
- http://sphinx-doc.org/install.html#installing-sphinx-with-easy-install
- http://www.sicafe.net/macPackageManageTips/html/homebrewPythonInstall.html
- https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
- http://stackoverflow.com/questions/15513840/distributionnotfound-error-after-upgrading-pip
- http://stackoverflow.com/questions/6200056/pip-broke-how-to-fix-distributionnotfound-error