Skip to content

Instantly share code, notes, and snippets.

@nobbynobbs
Last active November 10, 2019 13:51
Show Gist options
  • Save nobbynobbs/4af763b77692f7c08c73f5b482d7b9ef to your computer and use it in GitHub Desktop.
Save nobbynobbs/4af763b77692f7c08c73f5b482d7b9ef to your computer and use it in GitHub Desktop.
how to install geospatial libraries for python on ubuntu 18.04 (GDAL, mapnik)
# GDAL
sudo apt install gdal-bin libgdal-dev
pip install GDAL==$(gdal-config --version) --global-option=build_ext --global-option="-I/usr/include/gdal"
# MAPNIK
sudo apt install mapnik-utils libmapnik-dev libboost-all-dev
mapnik-config -v # check mapnik version
git clone https://github.com/mapnik/python-mapnik.git
cd python-mapnik
git checkout v3.0.x # checkout if your mapnik version is 3.0.x
# with activated virtualenv!!!
python setup.py install
cd ..
python
>> import mapnik
>> print(mapnik.mapnik_version())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment