[Gdal-dev] Python C API version mismatch

Sean Gillies sgillies at frii.com
Tue Apr 4 12:12:54 EDT 2006


On Apr 4, 2006, at 9:09 AM, John Cartwright wrote:

> Hello All,
>
> Can someone tell me what I might have done wrong in compiling gdal  
> 1.3.1 on linux? I get the following error upon importing the gdal  
> module:
>
> /data1/contrib/lib/python2.4/gdal.py:191: RuntimeWarning: Python C  
> API version mismatch for module _gdal: This Python has API version  
> 1012, module _gdal has version1011.
>
> I'm using python2.4.2, and these are my configure options:
>
> ./configure --prefix=/data1/contrib/gdal-1.3.1 \
> --with-png=internal \
> --with-libtiff=internal --with-geotiff=internal \
> --with-libz=internal --with-jpeg=internal --with-gif=internal \
> --with-pg=/usr/bin/pg_config \
> --with-mysql=/usr/bin/mysql_config \
> --with-oci=/usr/lib/oracle/10.2.0.1/client \
> --with-geos=/data1/contrib/geos-2.2.1/bin/geos-config \
> --with-pymoddir=/data1/contrib/lib/python2.4
>
> Thanks!
>
> -- john

John,

Is it possible that your pymoddir is not on your Python path, and  
that you're importing an older gdal.py?

I think your configure should probably have

   --with-pymoddir=/data1/contrib/lib/python2.4/site-packages

just for the sake of keeping site-packages like gdal in the right place.

Sean

---
Sean Gillies
http://zcologia.com






More information about the Gdal-dev mailing list