Python projects broken after upgrading to OS X Lion

Last night I upgraded to OS X Lion and all of my python projects stopped working. Even the basic command-line python utilities I rely on were throwing errors.

Several Google searches pointed me toward installing the newest version of XCode, but that didn't work.

As it turns out, it's not really XCode that you need... rather, what's needed are the latest versions of the command-line tools. In previous versions, those were an option in the installer which sets up XCode. However, as of version 4.3.2, XCode is distributed via the Mac App Store as an application, not as an installer.

Therefore, if you are having trouble getting python libraries to work after upgrading to OS X Lion, install the latest XCode from the App Store, and then open the preferences pane, click on the Downloads tab, and find "Command Line Tools", and click the install button next to it.

After adding the new command line tools, I was able to use pip install to get fabric and mercurial working again on my machine. Everything else seems to be fine.
comments powered by Disqus