Thursday, January 09, 2014

Upgrade To Mac OSx 10.9.1 Breaks pip

As with any upgrade to an operating system, you need to make sure that the things you use do not break.  Unfortunately, the breaks that happen are not always immediately apparent.

I decided to start playing with virtualenv (for creating virtual environments in python).  I was following a tutorial guide on virtualenv, the first steps being to install virtualenv using pip, which I have had installed on the machine for quite some time.

I attempted to run the command to install virtualenv:

sudo pip install virtualenv
and upon doing so I was met with the following message:

Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.
This made my eyebrow cock a bit as I know that pip was working only a week ago when I installed a couple of modules using it.  I thought quick, trying to determine what might have changed and then I remembered the OSx upgrade that I just did.  Awesome, they broke pip.

I'll admit that I went a bit of a long way around on this one, mostly because I wanted to make sure that other things weren't broken.  I thought quick about what, other than pip, I used to install things.  There is easy_install and also brew.

I decided to try 'sudo easy_install --upgrade pip' to see if that would resolve my pip issues.  It kindly told me it was already the most current verstion.   Awesome.

I then ran a 'brew update'.  Formulas were updated, but nothing major.  I then ran 'brew doctor'.  This provoded a lot more output of things.  I have a couple of apps that needed updtating, but the thing that stood out is there was also a complaint in its output about setuptools.  The output suggested running 'xcode-select --install' to resolve the setuptools issue, so I ran it.  The run took a few minutes, but did complete successfully.  I tried to again run the install command for virtualenv and STILL received the same error.  More research was obviously needed.

I Googled the error and found a StackOverflow post with the error that exactly matched what I had.  Per the most upvoted reply, I ran the following:

sudo pip install setuptools --no-use-wheel --upgrade

Then, for giggles, I started up XCode.  This immediately informed me that that there were updates that were needing to be done and applied, so I opted for them.  Once that completed, which took about 10 minutes, I went back and ran the install command for virtualenv.  Success!!!  WOO HOO!!!

The lesson here, if you upgrade, be prepared for things to break.  I found that it was my development tools that took the hit this time.  I have tested a number of other applications that I have on this machine, but nothing else seems to have any issues.  Hopefully your experience is a bit smoother.

No comments:

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.