[GIS] Python :ImportError: DLL load failed: The specified module could not be found

pluginspythonqgis

I am working on Python plugins for QGIS. I set my variables as

PATH :=C:\OSGeo4W\apps\qgis;%PATH% PYTHONPATH:=C:\OSGeo4W\apps\qgis\python

But when I try to run my .py file in IDLE I get an error saying:

Traceback (most recent call last):

File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 30, in from qgis.core import * ImportError: DLL load failed: The specified module could not be found.

What should I set for the PATH variable??

Best Answer

OK, looking at this logically, I would say you are missing a dll, or one is not registered. From our good friends over at stackoverflow, I have found using Dependency Walker as good a utility as you can find for working out precisely what your project is using, and, more importantly, what it wants to use and cannot find.

Run it and look at the outputs. If it still doesn't make sense, post the results here and we can look at them. It will be a missing/unregistered dll, if I were a gambling man.