Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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\", 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??

share|improve this question
Have you/is the dll registered? – Hairy Jan 25 '12 at 11:06

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.

share|improve this answer
ok..actually its a mistmatch between the versions..i gets this error for from qgis.core import * that: RuntimeError: the PyQt4.QtCore module is version 1 but the qgis.core module requires version -1 – Poonam Narvekar Jan 25 '12 at 12:05
This appears to be a bug - Can you post the full trace? – Hairy Jan 25 '12 at 13:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.