python GDAL 2.1 installation on Ubuntu 16.04
What worked for me is this: https://gis.stackexchange.com/a/193828/66527
Below, I copy that answer:
You can download GDAL 2.1 for Windows from GIS Internals. There is an installer and a portable version that doesn't require installation.
GDAL 2.1 is available for Ubuntu 16.04 from the UbuntuGIS-Stable PPA
sudo add-apt-repository -y ppa:ubuntugis/ppasudo apt update sudo apt upgrade # if you already have gdal 1.11 installed sudo apt install gdal-bin python-gdal python3-gdal # if you don't have gdal 1.11 already installed
Note Ubuntu 16.04 comes with python 3.5 but uses python 2.7 as default
"python-gdal" version 2.1.0 requires gdal version 2.1.0 . So the install of "libgdal1
" version 1.11.3 isn't sufficient. Get gdal-2.1.0 : http://download.osgeo.org/gdal/2.1.0/gdal-2.1.0.tar.gz
And the ~43 dependencies : $ sudo apt-get build-dep gdal
Building and installing gdal-2.1.0 and the Python bindings :
$ cd gdal-2.1.0/$ ./configure --prefix=/usr/$ make$ sudo make install$ cd swig/python/$ sudo python setup.py install
... No issues here, using Ubuntu 16.04 - 64bits.
Did you install python-dev
?
Before you install anything from source in Ubuntu, I suggest you take care of the build dependencies.
sudo apt-get build-dep python-gdal
Than try and run the installation.