<div dir="ltr"><span style="font-size:13px">I'm on Ubuntu 12.04. I ran this:</span><div style="font-size:13px"><div><br></div><div>apt-get install -y autoconf automake libtool make g++ gdal-bin libgdal1-1.7.0 libgdal1-dev python-gdal<br></div><div><br></div><div>That installed GDAL 1.7.3.</div><div><br></div><div>Then I ran this:</div><div><br></div><div><div>export CPLUS_INCLUDE_PATH=/usr/include/gdal</div><div>export C_INCLUDE_PATH=/usr/include/gdal</div></div><div><br></div><div>Then I `pip install`-ed a requirements.txt file with this in it:</div><div><br></div><div><a href="https://pypi.python.org/packages/source/G/GDAL/GDAL-1.7.1.tar.gz#md5=38b838d528b309a28a3aa24d4fcef3cd" target="_blank">https://pypi.python.org/packages/source/G/GDAL/GDAL-1.7.1.tar.gz#md5=38b838d528b309a28a3aa24d4fcef3cd</a><br></div><div><br></div><div>First I tried it without the two exports above and got these errors:</div><div><br></div><div><div>fatal error: cpl_port.h: No such file or directory</div><div>compilation terminated</div></div><div><br></div><div>I quickly found on Google that I needed those two exports to solve that problem. So I tried it with the two exports, and that solved that fatal error, but it revealed a whole new problem (the output was very long, so I truncated all the repetitive stuff off; I can supply full output on request):</div><div><br></div><div><div>  Running setup.py install for GDAL</div><div>    warning: build_py: byte-compiling is disabled, skipping.</div><div>    building 'osgeo._gdal' extension</div><div>    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/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/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: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>...</div><div>    extensions/gdal_wrap.cpp: In function ‘int wrapper_VSIFWriteL(int, char*, int, int, int*)’:</div><div>    extensions/gdal_wrap.cpp:3473:1: warning: control reaches end of non-void function [-Wreturn-type]</div><div>    error: command 'gcc' failed with exit status 1</div></div><div><div>Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-60DWKf-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-OEZ4Vd-record/install-record.txt --single-version-externally-managed --compile:</div><div>    running install</div><div>    running build</div><div>    running build_py</div><div>    creating build</div><div>    creating build/lib.linux-x86_64-2.7</div><div>    copying gdal.py -> build/lib.linux-x86_64-2.7</div><div>    copying ogr.py -> build/lib.linux-x86_64-2.7</div><div>    copying osr.py -> build/lib.linux-x86_64-2.7</div><div>    copying gdalconst.py -> build/lib.linux-x86_64-2.7</div><div>    copying gdalnumeric.py -> build/lib.linux-x86_64-2.7</div><div>    creating build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/gdal_array.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/gdal.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/osr.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/gdalconst.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/__init__.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    copying osgeo/ogr.py -> build/lib.linux-x86_64-2.7/osgeo</div><div>    warning: build_py: byte-compiling is disabled, skipping.</div><div>    running build_ext</div><div>    building 'osgeo._gdal' extension</div><div>    creating build/temp.linux-x86_64-2.7</div><div>    creating build/temp.linux-x86_64-2.7/extensions</div><div><br></div><div>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/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o</div><div><br></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: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:3034: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><br></div><div>Googling those errors, I also find solutions that say I need to use the two exports above, but given that I AM using those exports, and that it solved my earlier fatal error, I'm guessing that's not the problem here.</div><div><br></div><div>I've tried instead pip installing GDAL-1.9.1.tar.gz and GDAL-2.0.1.tar, but those just fail earlier with different fatal errors. I'm under the impression here that I need to match the Python GDAL library version with the libgdal and python-gdal versions, so I think GDAL-1.7.1.tar.gz is right. But I can't get the requirement to successfully install.</div></div><div style="font-size:13px"><br></div><div style="font-size:13px">Help?</div><div style="font-size:13px"><br></div><div style="font-size:13px">Thanks,</div><div style="font-size:13px"><br></div><div style="font-size:13px">Nick</div></div>