Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing GDAL

Tags:

python

pip

gdal

I'm trying to install GDAL through pip. But I'm getting this error:

extensions/gdal_wrap.cpp:3089:27: fatal error: cpl_vsi_error.h: No such     file or directory  #include "cpl_vsi_error.h"                            ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

I used these commands:

sudo apt-get install libgdal-dev export CPLUS_INCLUDE_PATH=/usr/include/gdal export C_INCLUDE_PATH=/usr/include/gdal pip install GDAL 

Can anyone tell me how to install it ?

like image 637
Rahul Avatar asked Jul 28 '16 08:07

Rahul


People also ask

Can you install GDAL with PIP?

gdal-utils: is the GDAL Python Utilities distribution. This is what you install. Its home page is https://pypi.org/project/gdal-utils/ . Install with pip install gdal-utils .

What version of Python does GDAL use?

Currently, GDAL Python code itself is compatible with Python 2 and Python 3.

Is GDAL installed Linux?

GDAL is available in the default repositories of most popular Linux distributions and can be installed in the same way that packages in a Linux distribution are usually installed. CPLUS_INCLUDE_PATH and C_INCLUDE_PATH are necessary in order to include these corresponding libraries.


1 Answers

Check that you installed GDAL using this command

gdal-config --version 

Then run this commands:

pip download="some_path" GDAL cd some_path tar -xvzf GDAL-<version>.tar.gz cd GDAL-<version> python setup.py build_ext --include-dirs=/usr/include/gdal/ python setup.py install 
like image 154
Dima Kudosh Avatar answered Sep 22 '22 10:09

Dima Kudosh