python GDAL 2.1 installation on Ubuntu 16.04

∥☆過路亽.° 提交于 2019-11-27 11:02:11
Akhorus

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/ppa
sudo 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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!