Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install the GDAL python package in a python 2.7.1 environment on RHEL 5. I am using the command 'pip install GDAL'. I have no problem installing other packages like numpy, etc. in this manner.

The installation fails with this error:

extensions/gdal_wrap.cpp: In function 'PyObject* _wrap_VSIFTruncateL(PyObject*, PyObject*)':

extensions/gdal_wrap.cpp:6845: error: 'VSIFTruncateL' was not declared in this scope

error: command 'gcc' failed with exit status 1

I also tried compiling GDAL 1.9.0 from source and running 'python build' (after setting the path to gdal-config in setup.cfg) and 'python install'. The GDAL python bindings seem to install okay, but I get the same 'VSIFTruncateL' error when trying to use GDAL...

>>> from osgeo import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "osgeo/", line 21, in <module>
    _gdal = swig_import_helper()
  File "osgeo/", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: osgeo/ undefined symbol: VSIFTruncateL
share|improve this question
up vote 3 down vote accepted

Does the version of the GDAL python package you are trying to install match the one for your GDAL installation?

I was having the same problem because I was trying to build the GDAL python package v1.9.0 against GDAL v1.8.1 that I had previously installed on my development machine.

Simply telling pip to use v1.8.1 solved this issue for me.

pip install GDAL==1.8.1

NOTE: I'm using a Mac but was seeing the exact same error as you.

share|improve this answer
Sorry for the late response. It turns out there was an old version of GDAL installed elsewhere on the server, and it was being picked up during the build. So it was similar to what you described. All fixed now. Thanks! – vulture May 28 '12 at 6:53

Ran into the same error when trying to upgrade my GDAL from 1.9.0 to 1.11.0. Looks like on some Linux systems, there is some sort of library caching that can interfere. Doing the following:


or for bash environments:


was all I needed (substituting what ever you set for your prefix when you configured).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.