[Gdal-dev] Beginner problem - can't load DLL

=?gb2312?B?2k+9qMP3?= yunjm2005 at gmail.com
Sun Nov 5 22:24:23 EST 2006

to Mateusz Loskot:

thank you very much!
I'm sorry to my unclearly language.
I use the IDE PythonWin.
According to your direction i have solved my problem.
It's really like you say,i have set the Python path but not set the OS's Path to search my dll,so the problem occur.
Thanks again!


·¢¼þÈË£º Mateusz Loskot
·¢ËÍʱ¼ä£º 2006-11-06 00:35:48
ÊÕ¼þÈË£º gdal-dev at lists.maptools.org
Ö÷Ì⣺ Re: [Gdal-dev] Beginner problem - can't load DLL

ÚO½¨Ã÷ wrote:
> what is the detail to set up my IDE to work with the FWTools's python
> version?

What do you mean "my IDE"?

> I have modify my set up by it still report can't load Dll.
> I have Edit all the value under Tools|Edit python path|  to
> 'C:\\FWTools' like
> but when i check the sys.path it's value like the following message:

What's Tools|Edit?

> PythonWin 2.3.5 (#62, Feb  9 2005, 16:17:08) [MSC v.1200 32 bit (Intel)]
> on win32.
> Portions Copyright 1994-2004 Mark Hammond (mhammond at skippinet.com.au
>  <mailto:mhammond at skippinet.com.au >) - see 'Help/About PythonWin' for
> further copyright information.
> > > > import sys
> > > > print(sys.path)
> ['', 'C:\\WINDOWS\\system32\\python23.zip', 'C:\\FWTools\\bin',
> 'C:\\FWTools\\pymod', 'C:\\Python23\\DLLs', 'C:\\Python23\\lib',
> 'C:\\Python23\\lib\\plat-win', 'C:\\Python23\\lib\\lib-tk',
> 'C:\\Python23\\Lib\\site-packages\\pythonwin', 'C:\\Python23',
> 'C:\\Python23\\lib\\site-packages',
> 'C:\\Python23\\lib\\site-packages\\win32',
> 'C:\\Python23\\lib\\site-packages\\win32\\lib']
> > > > import gdal
> Traceback (most recent call last):
>   File " <interactive input >", line 1, in ?
>   File "C:\FWTools\pymod\gdal.py", line 191, in ?
>     import _gdal
> ImportError: DLL load failed: ÕÒ²»µ½Ö¸¶¨µÄÄ£¿é¡£

I suppose the problem is that GDAL DLL can't be found by your IDE,
whatever the IDE means.
Try to add path where GDAL DLL file lives to system-wide or user's
PATH environment variable.
sys.path represents Python's PYTHONPATH, not Windows PATH where exe and
dll files are searched for.

Alternatively, you can try to open FWTools command line (use shortcut in
Start Menu - > FWTools) and run your IDE from command line, then it should
inherit PATH settings from FWTools shell.

Mateusz Loskot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20061106/467ea086/attachment.html

More information about the Gdal-dev mailing list