[Gdal-dev] Beginner problem - can't load DLL
Matthew Perry
perrygeo at gmail.com
Sun Mar 12 21:27:04 EST 2006
On 3/12/06, Holywhippet <amills at frogtech.com.au> wrote:
> I'm trying to write a fairly simple program that will extract the data from
> an Erdas Imagine file into an ASCII file. Normally I'd use the Arc software
> for something like this but in this case I have to make a standalone program
> that can be handed around freely. After some searching I found GDAL which I
> can use to read the Imagine format.
If you just need a utility to convert from ERDAS to a standard ArcInfo
ASCII Grid, you can use the gdal_translate program
(http://gdal.maptools.org/gdal_translate.html) that comes with
FWTools. The command would be something like:
gdal_translate -of "AAIGrid" input.img output.asc
But if you need to customize the output, you can turn to the
GDAL/python solution.
> However, when I give it this command:
>
> import gdal
>
> I get the following error:
>
> Traceback (most recent call last):
> File
> "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
> File "C:\Frogtech\testScript.py", line 1, in ?
> import gdal
> File "C:\Python24\lib\gdal.py", line 191, in ?
> ImportError: DLL load failed: The specified module could not be found.
>
Looks like your IDE is trying to run the system's version of Python.
FWTools comes with it's own version of Python and installs the GDAL
libs there. You'll probably need to set up your IDE to work with that
version somehow.
--
Matt Perry
perrygeo at gmail.com
http://www.perrygeo.net
More information about the Gdal-dev
mailing list