Error :No module named qgis
Asked Answered
O

1

7

I am working on Python26,pyqt4 designer and QGIS. My code file (.py file)contains this:

   import sys
   from PyQt4 import QtGui, QtCore
   from qgis.core import *
   from qgis.gui import *

but when i try to run it it gives error saying:

Traceback (most recent call last):
  File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 29, in <module>
    from qgis import core,gui
ImportError: No module named qgis

I already set PATH in environmental variable as

C:\Program Files\Quantum GIS Wroclaw\bin
C:\Program Files\Quantum GIS Wroclaw\apps\qgis\bin
Overhand answered 19/1, 2012 at 7:42 Comment(2)
Did you set PATH or PYTHONPATH?Externalize
i set just PATH...not pythonpath..wat to set for pythonpath?Overhand
E
2

If you set just PATH instead of PYTHONPATH, my advice would be to check if the location of the module you want to import is in the PYTHONPATH and, if that's not the case, set the PYTHONPATH appropriately.

Externalize answered 19/1, 2012 at 7:54 Comment(1)
i set pythonpath to C:\Python26\Lib\site-packages;C:\Program Files\Quantum GIS Wroclaw\apps\qgis\python;C:\Python26\DLLs; ....now m getting the error : Traceback (most recent call last): File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 29, in <module> from qgis import core,gui ImportError: DLL load failed: The specified procedure could not be found.Overhand

© 2022 - 2024 — McMap. All rights reserved.