Homebrew is good software, a straightforward way to compile and run traditional Unix tools on MacOS. However it's got some sharp corners, particularly for Python, and you need to be paying attention. Long story short: if you're using Homebrew's version of Python, be sure you have /usr/local/share/python in your PATH. If you don't your environment is broken and wrong. In particular, pip and easy_install will be installing things in Apple's version of Python, not Homebrew's.

If you're the type of guy who reads directions, you already have that odd directory in your PATH. Because brew install python told you to do that. You can see it again, go run brew info python. See? This is all well documented, too. I'm not the kind of guy to read directions. Years of using Debian has conditioned me that the package manager will install things cleanly and for the very few things that need intervention I'll get a little console warning in bright colors. Homebrew's not like that, many packages print caveats and you're expected to read them. (In the same vein, if you're doing geo-hacking and use gdal, you might want to check brew info gdal and whether your PYTHONPATH includes /usr/local/lib/python. Also see these notes on building numpy on Lion.)

I opened a github issue suggesting brew doctor diagnose this missing Python path. I'd just write the patch, but the hurdle of doing Ruby and github right is a little high for me right now.

  2011-09-24 16:07 Z