[gdal-dev] Python 3 on Ubuntu 11.10

David Hodo david.hodo at gmail.com
Wed Apr 25 14:32:28 EDT 2012


I'm trying to install GDAL for Python 3 on Ubuntu 11.10 and having some
problems.  I installed GDAL 1.7.0 and the header files from with Synaptic.
 I initially tried installing the Python bindings with 'sudo easy_install
GDAL'.  This worked for me, but the installed version does not work with
Python 3.

I then tried downloading the latest version from the website and installing
with 'python3.2 setup.py build', but the command fails with the error:

running build
running build_py
running build_ext
building 'osgeo._gdal' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC
-I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/include/gdal/
-I/usr/include/python3.2mu -I. -I/usr/include -c extensions/gdal_wrap.cpp
-o build/temp.linux-x86_64-3.2/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: In function ‘void
SWIG_Python_SetModule(swig_module_info*)’:
extensions/gdal_wrap.cpp:2535:22: warning: unused variable
‘swig_empty_runtime_method_table’ [-Wunused-variable]
extensions/gdal_wrap.cpp: At global scope:
extensions/gdal_wrap.cpp:2999:67: error: ‘VSILFILE’ has not been declared
extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFReadL(void**, int,
int, int*)’:
extensions/gdal_wrap.cpp:3018:72: error: cannot convert ‘int*’ to ‘FILE*
{aka _IO_FILE*}’ for argument ‘4’ to ‘size_t VSIFReadL(void*, size_t,
size_t, FILE*)’
extensions/gdal_wrap.cpp: In function ‘int PyProgressProxy(double, const
char*, void*)’:
extensions/gdal_wrap.cpp:3236:2: warning: the address of ‘_Py_NoneStruct’
will never be NULL [-Waddress]
extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIStatL(const char*,
StatBuf*, int)’:
extensions/gdal_wrap.cpp:3457:52: error: ‘VSIStatExL’ was not declared in
this scope
extensions/gdal_wrap.cpp: At global scope:
extensions/gdal_wrap.cpp:3465:67: error: ‘VSILFILE’ has not been declared
extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFWriteL(int, char*,
int, int, int*)’:
extensions/gdal_wrap.cpp:3472:42: error: cannot convert ‘int*’ to ‘FILE*
{aka _IO_FILE*}’ for argument ‘4’ to ‘size_t VSIFWriteL(const void*,
size_t, size_t, FILE*)’
extensions/gdal_wrap.cpp: At global scope:
extensions/gdal_wrap.cpp:3801:5: error: ‘GDALAsyncReaderH’ does not name a
type
extensions/gdal_wrap.cpp:3807:8: error: ‘GDALAsyncReaderH’ does not name a
type
extensions/gdal_wrap.cpp: In function ‘void
DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH)’:
extensions/gdal_wrap.cpp:3826:20: error: ‘struct GDALAsyncReaderWrapper’
has no member named ‘hAsyncReader’
....

There are another 10 or 15 errors mostly related to VSILFILE not being
declared.

Any suggestions on how to get GDAL working for Python3?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120425/b94e0d27/attachment.html


More information about the gdal-dev mailing list