[FWTools] Re: gdal/ogr and python 2.5

Mateusz Loskot mateusz at loskot.net
Fri Aug 10 15:21:18 EDT 2007


Claudio A. Quezada R. wrote:
>
> There´s some doubts. I´d like to import gdal on python. So if i´m on
> windows i probably need the binary archives of GDAL, and GDAL for
> python...
>
> If i only build GDAL with "./configure --with-python" in MSYS, i´l get
> gdal.dll with python support, right?

You have to be warned that MinGW is not officially supported
(http://trac.osgeo.org/gdal/wiki/SupportedCompilers),
so not tested well especially features like Python support.
Yes, people use MinGW with success, so you may try to find
helpful information in the gdal-dev and fwtools list archives,
on the Wiki (http://trac.osgeo.org/gdal/wiki/BuildingWithMinGW)
but personally I won't be very helpful about MinGW :-(

> Well, when i configure GDAL it says:
>
> checking for top-level Makefile for Python... missing, Python disabled.
>
> Traditional Python:        no

It likely means that Python files can not be found by ./configure.
The ./configure tests if Python and its development files like
header/library are available.

Also, according to the GDAL FAQ, there are some complications possible
if used with MinGW, and as you see Python disable is suggested when
building with MinGW:

http://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#CanIbuildGDALwithCygwinorMinGW


> And this are the questions:
> 1) where can i get (or build) GDAL for python?

Have you tried official binaries:

http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries

> 2)I try ./configure --with-python but it doesn´t work, i probably
> forgot something...

Python can not be detected (see above).

> 3) I do have a Python_GDAL-1.4.2w32.zip, and in this scripts import
> Numeric (besides it needs Python 2.4).

That's OK.
You should know that there are two versions of Python support:
- old, called Traditional Python
- new based on SWIG, called Next Generation

The old bindings use old Numeric.
The new SWIG-based use NumPy.
So, the package you have provides old Traditional Py support that
uses Numeric.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the FWTools mailing list