The suggested way to handle pip(easy_install) with homebrew?

Posted by Drake on Super User See other posts from Super User or by Drake
Published on 2012-02-12T02:18:29Z Indexed on 2012/10/31 11:04 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

I know there are brew-gem and brew-pip but it is still really easy to get confused. Let's say my Mac OS X is 10.7.2.

  • There are at least, as far as I know, 3 locations for Python modules (assume 2.7):
    1. /System/Library/Frameworks/Python.framework/Versions/2.7/
    2. /Library/Python/2.7/site-packages
    3. /usr/local/lib/python2.7/site-packages/ (controlled within homebrew)
  • For some Python modules, pip install them into 2, the so-called local/customized Python module location, and everything looks and works great. Ex, readline by *easy_install* (ipython suggested me to install readline by *easy_install* instead of pip)
  • For some, it would try to install some miscellaneous files (ex, man, doc, ...) into system-wide location, which requires sudo! Ex, ipython insisted on installing man and doc into /System/Library/Frameworks/Python.framework/Versions/2.7/share/, which violates permission issue and all I can do is to use sudo.
  • For some Python modules installed by brew, they are symbolic linked to /usr/local/lib/python2.7/site-packages/. Everything seems great except that you have to remember to add this location into PYTHONPATH.

I am wondering any suggested and uniform way to handle those mass, or any explanation to make those stuff crystal clear.

© Super User or respective owner

Related posts about python

Related posts about homebrew