I hate installing Python libraries

(Caution: intemperate angry rant follows.)

I’m wasting more than an hour figuring out the fuckup of building GDAL to run in a virtualenv on Ubuntu 14.04 LTS. This hasn’t worked well in the year+ I’ve been trying, and it’s not working well now.

  1. set up a new virtualenv and activate it
    virtualenv -p /usr/bin/python2.7 venv
    source venv/bin/activate
  2. Install the openaddresses repo I have
    cd ~/src/oa/machine/
    pip install -e .
  3. Manually install cairo cffi (shouldn’t pip have done this?)
    sudo apt-get install libffi-dev python-cffi
    pip install cairocffi
  4. Give up trying to install GDAL with pip. Even after you work through the include path packaging problems, the C compiler starts throwing errors about variable scoping.
  5. Start over with a virtualenv that also uses system packages, which somehow seem to be working.
    virtualenv –system-site-packages -p /usr/bin/python2.7 venv

I shouldn’t publish my angry rant. GDAL is great software, and I appreciate all the volunteer open source effort. But something about dealing with packages and software installation is just so maddening. I think it’s because hiding behind “pip install gdal” is about 200,000 lines of complex code in multiple languages from multiple distributers. When it works its awesome. When it fails all you can do is try searching the error message and cargo culting a solution, which only works 1/3 of the time.

grawr.

 

One thought on “I hate installing Python libraries

  1. I’ve had (mildly) better luck apt-getting (-dev) or source compiling the C stuff and then pipping the pythonry on top. It’s still laborious and frustrating but often slightly more manageable than pure, broken pip.

Comments are closed.