[gdal-dev] gdal and python 2.5

Mateusz Loskot mateusz at loskot.net
Fri Dec 7 16:56:13 EST 2007


Michael ODonnell wrote:
> Hi, I am new to this group and a relatively new user of gdal and
> python. I have been using a gdal python binary with python 2.4.1 on
> Windows XP, but I was forced to upgrade to 2.5.1 python. I have seen
> a couple postings in the last few months (gdal discussion list) on
> this topic and I was curious if anyone has built gdal binaries for
> python 2.5.1?

We use Python 2.4 + GDAL built using Visual C++ 2005 on Buildbot slaves
under Windows with success. I also use the same Python and compiler on
my own machine with success.

Although, there are a few tricks required to succeed with GDAL binaries
built using Visual C++ 2005. Check "Testing on Windows using old
bindings" for details:

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

Unfortunately, Python 2.5 does not work for me and these hacks do not
help. Just to confirm it, I run simple test a few minutes ago:

1. Python 2.4 + GDAL + Visual C++ 2005

D:\dev\gdal\_svn\trunk\gdal>c:\Python24\python.exe
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
>>>

2. Python 2.4 + GDAL + Visual C++ 2005

D:\dev\gdal\_svn\trunk\gdal\pymod>c:\Python25\python.exe
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gdal.py", line 191, in <module>
    import _gdal
ImportError: No module named _gdal
>>>

In both cases I use GDAL from SVN and old-gen Python bindings in
trunk/gdal/pymod.

> Is this possible without making a lot of changes to gdal and is
> numeric still required or has gdal switched over to numpy entirely?

I don't know.

> What version of VS would be required?

I believe you can use any VS version.
Similarly, Python 2.4 was supposed to not to work with Visual C++ 2005
because of manifest issues, but we (Tamas) have found how to do it
and tested it in practice. Tamas uses this tricks on his buildbot
slaves: Python 2.4 + Visual Studio 2005. See szekerest-* machines here:

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

I use it on my own installation of Windows XP + Python 2.4.

> Does anyone know what compiler was used for python 2.5.1?

Visual C++ 7.1 (2003)

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


More information about the gdal-dev mailing list