Getting Python Ready for OS X Upgrades

Every OS X upgrade breaks my python installation. I think this is a common problem for dummies like me that are not using virtualenv for everyday use.

With Mavericks on its way (presumably next week), I decided to plan ahead.1 First, I generated a list of all of my installed Python packages. The most common way to do this is with the freeze command. It’s pretty simple.

To get a simple listing of all modules, just run this:

pip freeze > installed_modules.txt

But Yolk is also an excellent little Python tool for figuring our what’s currently installed. It provides a huge amount of detail about the current state and installation location of all modules.

Run the following to get an exhaustive listing:

pip yolk

I’ll still have to reinstall all of my packages on Mavericks, but at least I’ll have a list of what I need. That might make life easier.

My new OS resolution this year is virtualenv for everything. I’m not sure if this will make my future upgrades easier, but it seems like the right thing to do.

  1. I did this with Mountain Lion too. Lion was where I started to get a clue↩︎