Python: dealing with ZipImportError in setuptools


Mag 4 2011, 17:36

I spent most of today wrestling with a build problem in one of our internal Python modules. We use zc.buildout to automatically pull in the dependencies and build all the components for each module, but one of them started mysteriously failing with an error like this:

Installing scripts.
Getting distribution for ''.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
ZipImportError: bad local file header in /blah/blah/

This was particularly weird, as I could unzip that file fine with no problems.

Eventually I got some good advice from Alexis on the #distutils Freenode channel -- try using distribute, which is the successor to setuptools, as discussed here.

So I got a new version of from here, ran it with the --distribute flag, then ran bin/buildout again -- and it all worked.

Why it failed in the first place is still a total mystery though :-)


  • gskumar

    I am taking this opportunity to share some thoughts while I continue to be one of Last.Fm avid listener. Recently I bought a LED TV which has some interesting features like connecting to Wifi Routers which means the TV is internet Ready. I plugged the HDMI ports to my Amp and a perfect solution with minimal wires Music, Video or TV all in One with Single Remote control. Thats when I was wondering while reviewing some of the inbuilt Applications like YouTube, Flickr why not which means I can power my TV to the best of Music. I thought for this could mean additional Channel to distribute reaching out and delivering quality User Experience. Should you feel this is a good idea would be good to hear back on

    Mag 6 2011, 9:58
  • andrewclegg

    Hi gsukmar, thanks for the suggestion. We're continually on the lookout for new partnerships for music delivery, keep watching the site for news :-)

    Mag 6 2011, 10:44
Visualizza tutti (2 commenti)
Aggiungi un commento. Accedi a o registrati (è gratuito).