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. <div>
<br></div><div>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:</div><div><br></div><div><div>running build</div><div>
running build_py</div><div>running build_ext</div><div>building 'osgeo._gdal' extension</div><div>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</div>
<div>cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]</div><div>extensions/gdal_wrap.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’:</div>
<div>extensions/gdal_wrap.cpp:2535:22: warning: unused variable ‘swig_empty_runtime_method_table’ [-Wunused-variable]</div><div>extensions/gdal_wrap.cpp: At global scope:</div><div>extensions/gdal_wrap.cpp:2999:67: error: ‘VSILFILE’ has not been declared</div>
<div>extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFReadL(void**, int, int, int*)’:</div><div>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*)’</div>
<div>extensions/gdal_wrap.cpp: In function ‘int PyProgressProxy(double, const char*, void*)’:</div><div>extensions/gdal_wrap.cpp:3236:2: warning: the address of ‘_Py_NoneStruct’ will never be NULL [-Waddress]</div><div>extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIStatL(const char*, StatBuf*, int)’:</div>
<div>extensions/gdal_wrap.cpp:3457:52: error: ‘VSIStatExL’ was not declared in this scope</div><div>extensions/gdal_wrap.cpp: At global scope:</div><div>extensions/gdal_wrap.cpp:3465:67: error: ‘VSILFILE’ has not been declared</div>
<div>extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFWriteL(int, char*, int, int, int*)’:</div><div>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*)’</div>
<div>extensions/gdal_wrap.cpp: At global scope:</div><div>extensions/gdal_wrap.cpp:3801:5: error: ‘GDALAsyncReaderH’ does not name a type</div><div>extensions/gdal_wrap.cpp:3807:8: error: ‘GDALAsyncReaderH’ does not name a type</div>
<div>extensions/gdal_wrap.cpp: In function ‘void DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH)’:</div><div>extensions/gdal_wrap.cpp:3826:20: error: ‘struct GDALAsyncReaderWrapper’ has no member named ‘hAsyncReader’</div>
</div><div>....</div><div><div><br></div></div><div>There are another 10 or 15 errors mostly related to VSILFILE not being declared.</div><div><br></div><div>Any suggestions on how to get GDAL working for Python3?</div><div>
<br></div><div>Thanks,</div><div><br></div><div>David</div>