How to build and install gdal python binding from source using MinGW

المشرف العام

Administrator
طاقم الإدارة
I was wondering how can I installed the gdal python binding from source using MinGW (including scripts such as gdal_calc.py).

I've searched around and found this question about How to install GDAL with Python on windows?, but it was about installing gdal binaries. I need to install from source because I have other libraries in my MinGW/MSYS.

So far, I have downloaded gdal-1.11.2.tar.gz, and did:

./configure --with-python=/c/Python27/ArcGIS10.2/python.exemake && make install/c/Python27/ArcGIS10.2/python.exe above is the python binary from ArcGIS 10.2. I also followed http://trac.osgeo.org/gdal/wiki/BuildingWithMinGW to edit $PYTHON_ROOT\lib\distutils\ccompiler.py.

But I cannot get past the last step make install. Although I have ./swig/python/scripts/gdal_calc.py in the make folder, gdal_calc.py is not installed to the msys folder.

I was wondering if anyone can suggest the right way to compile from source here?

The error message I got was:

make[1]: Entering directory `/c/temp/src/gdal-1.11.2/swig'for dir in python ; do (cd $dir; make install) || exit; donemake[2]: Entering directory `/c/temp/src/gdal-1.11.2/swig/python'/c/Python27/ArcGIS10.2/python.exe setup.py install --prefix=/usr/localrunning installrunning buildrunning build_pyrunning build_extTraceback (most recent call last): File "setup.py", line 320, in ext_modules = ext_modules ) File "c:\Python27\ArcGIS10.2\lib\distutils\core.py", line 152, in setup dist.run_commands() File "c:\Python27\ArcGIS10.2\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "c:\Python27\ArcGIS10.2\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "c:\Python27\ArcGIS10.2\lib\distutils\command\install.py", line 563, in run self.run_command('build') File "c:\Python27\ArcGIS10.2\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "c:\Python27\ArcGIS10.2\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "c:\Python27\ArcGIS10.2\lib\distutils\command\build.py", line 127, in run self.run_command(cmd_name) File "c:\Python27\ArcGIS10.2\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) File "c:\Python27\ArcGIS10.2\lib\distutils\dist.py", line 971, in run_command cmd_obj.ensure_finalized() File "c:\Python27\ArcGIS10.2\lib\distutils\cmd.py", line 109, in ensure_finalized self.finalize_options() File "setup.py", line 196, in finalize_options self.gdaldir = self.get_gdal_config('prefix') File "setup.py", line 176, in get_gdal_config return fetch_config(option) File "setup.py", line 129, in fetch_config raise gdal_config_error, e""") File "", line 4, in __main__.gdal_config_error: [Error 2] The system cannot find the file specifiedmake[2]: *** [install] Error 1make[2]: Leaving directory `/c/temp/src/gdal-1.11.2/swig/python'make[1]: *** [install] Error 2make[1]: Leaving directory `/c/temp/src/gdal-1.11.2/swig'make: *** [install-actions] Error 2Thanks



أكثر...
 
أعلى