Get gdal development libraries:
$ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
$ sudo apt-get update
$ sudo apt-get install libgdal-dev
Create and activate a virtual environment:
$ virtualenv gdalenv
$ source gdal/bin/activate
Download GDAL:
(gdalenv) $ pip install --no-install GDAL
Specify where the headers are:
(gdalenv) $ cd /path/to/gdalenv/build/GDAL
(gdalenv) $ python setup.py build_ext --include-dirs=/usr/include/gdal/
Install GDAL:
(gdalenv) $ pip install --no-download GDAL
Done.
@abhijayQuantela I had the same issue and found this to work
optional: install the newest version of
gdal-bin
andlibgdal-dev
:My gdal version was 2.2.3, so mayve specifically install that one if this does not work.
required: install using pip3: