[Gdal-dev] just trying to install/import

Mateusz Łoskot mateusz at loskot.net
Tue May 16 15:40:41 EDT 2006


Jeremy Freund wrote:
> hello Mateuz,
> 
> thank you so much for your reply! I know it was a bit general...I'll try
> to be more specific. Basically, I am trying to install the Gdal wrapper
> for PythonWin 2.4. I downloaded what I assume is the source files for
> windows (gdal132.zip), unzipped the files to a folder called 'gdal132'
> and placed this folder under the /Lib/site-packages directory. 

It won't work!
Thiz zip package is a source distribution, so you have to compile it to
have all binaries ready to use.
If you don't want to compile GDAL yourself, then you need to use FWTools
as I explained in my previous post.

> I then
> modified the Python path using
> sys.path.append('C:\Python24\Lib\site-packages\gdal\pymod') to try to
> force python to see 'gdal.py'  in the module path. When I attempt an
> 'import gdal', I get the following error:
> 
>>>> import gdal
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
>   File "gdal.py", line 191, in ?
>     import _gdal
> ImportError: DLL load failed: The specified module could not be found.
> 
> I assume that '_gdal' is a dll, 

It's a module loaded by Python, but the ZIP you downlaoded does not
include it in binary form. FWTools are recommended, out-of-box GDAL version.

> and I also assume that your comment
> about the dll needing to be in the execution path is probably pertinent
> here. I suppose, with that said...what exactly is the execution path,
> how does it differ from the module path and most importantly how do I
> place dlls in it? Your help is greatly appreciated.

I meant the PATH environment variable.

> Incidentally, I did end up installing fwtools. However, I have a need to
> get gdal running the way I described...

So, you need to build it yourself.
After you unzipped the gdal132.zip you have to build it.
The python module (traditional pymod) is in gdal-1.3.2/pymod
so step inside - after you build the main DLL - and run:

nmake /f makefile.vc

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list