The Vexing zlib Problem with Snow Leopard

Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in
from pkg_resources import load_entry_point
zipimport.ZipImportError: can't decompress data; zlib not available

Seen this when working with python on OS X 10.6 (Snow Leopard)?

This seemingly came out of nowhere when I wanted to set up a virtualenv on a macbook pro that hadn’t been used for python recently.

I tried all sorts of approaches to deal with the pesky zlib to no avail.

What finally worked was rm-ing the .virtualenv dir in my user home dir and removing all references to that directory in my .bashrc.

I then reinstalled setuptools and was able to get easy_install and pip running following that.

If you’re seeing that error coming up it may be problems with your shell initialization sequence. Check it out!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s