python GDAL 2.1 installation on Ubuntu 16.04

后端 未结 4 1019
有刺的猬
有刺的猬 2020-12-02 10:01

Here will be my sequence of command lines while trying to install gdal2.1 in a UBUNTU virtual machine. My virtual machine is a UBUNTU 16.04 LTS(64bit) I would need gdal2.1 a

相关标签:
4条回答
  • 2020-12-02 10:19

    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

    0 讨论(0)
  • 2020-12-02 10:21

    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.

    0 讨论(0)
  • 2020-12-02 10:33

    "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.


    0 讨论(0)
  • 2020-12-02 10:34
    sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
    
    sudo apt-get update
    
    sudo apt-get install gdal-bin
    
    sudo apt-get install libgdal-dev
    
    export CPLUS_INCLUDE_PATH=/usr/include/gdal
    
    export C_INCLUDE_PATH=/usr/include/gdal
    
    pip install --global-option=build_ext --global-option="-I/usr/include/gdal/" GDAL==2.0.1
    
    0 讨论(0)
提交回复
热议问题