(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.
- set up a new virtualenv and activate it
virtualenv -p /usr/bin/python2.7 venv
- Install the openaddresses repo I have
pip install -e .
- Manually install cairo cffi (shouldn’t pip have done this?)
sudo apt-get install libffi-dev python-cffi
pip install cairocffi
- 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.
- 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.