I am trying to set CartoDB in Ubuntu 12.04. I am trying to install Python dependencies as a part of my installation. I am installing with below commands

export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
sudo pip install GDAL
cd /tmp/pip_build_root/GDAL
sudo python setup.py build_ext --include-dirs=/usr/include/gdal
sudo pip install --no-download GDAL

While i am trying to execute the third command sudo pip install GDAL am getting the below error

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/include/python2.7 -I. -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
extensions/gdal_wrap.cpp:2859:22: fatal error: cpl_port.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1


Command "/usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-PMhlKD/GDAL/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-0u9jBS-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-PMhlKD/GDAL

  • 1
    Do you require a certain version of GDAL? If not the easiest way would be to use the default repo which is currently at 1.11.2 sudo apt-get install gdal-bin python-gdal. – Kersten Oct 19 '15 at 7:45
  • I require GDAL version greater than 1.10. – User123 Oct 19 '15 at 8:03
  • 1
    Then using GDAL from the default repo should solve your issue. If you require a more current version than that you could also use the ubuntugis repository: sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable && sudo apt-get update – Kersten Oct 19 '15 at 8:09
  • Try installing python-dev like this. – blu_sr Oct 19 '15 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.