[Pythonmac-SIG] easy_install broken on new macbook (includes solution)

Amos Latteier amos at latteier.com
Mon Oct 20 01:42:55 CEST 2008


I just got a new aluminum macbook. It's great expect that it seems to
ship with a broken easy_install. I tracked down the problem and
submitted a bug to apple (bug #6302565). I'm sending the details
to this mailing list in hopes that it can help others, or perhaps others
can point out a better solution.


The easy_install python command line tool fails to install python
package that include c extensions on my new macbook.

Here's how to reproduce the problem:

  $ easy_install simple_json

You will get an error message that ends with an error message like this:

  No eggs found in
  3CNYn-/simplejson-2.0.3/egg-dist-tmp-EOUkj5 (setup script problem?)
  error: Could not find required distribution simplejson

You don't have to use simple_json, any python package with c
extensions will trigger the problem.

The problem is that the apple-specific version of pkg_resources.py (in
shipped with the new macbooks changes the macos version number (line

  def _macosx_vers(_cache=[]):
      if not _cache:
          # don't call sw_vers because that causes a SIGTRAP in gdb
          _cache = [['10.5', '1']]
      return _cache[0]

Previously the version was 10.5, not 10.5.1. This change is a problem
because the regular expression that checks version numbers (on line
194) doesn't work with it.

  macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)(.*)")

One solution is to change the regular expression to something like the

  macosVersionString = re.compile(r"macosx-(\d+)\.(\d+).*?-(.*)")

I have verified that this fix solves the problem for me.

More information about the Pythonmac-SIG mailing list