错误:没有名为 qgis 的模块
我正在研究Python26、pyqt4 设计器和QGIS。我的代码文件(.py 文件)包含以下内容:
import sys
from PyQt4 import QtGui, QtCore
from qgis.core import *
from qgis.gui import *
但是当我尝试运行它时,它给出错误消息:
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
我已经将环境变量中的 PATH 设置为
C:\Program Files\Quantum GIS Wroclaw\bin
C:\Program Files\Quantum GIS Wroclaw\apps\qgis\bin
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您仅设置
PATH
而不是PYTHONPATH
,我的建议是检查要导入的模块的位置是否在PYTHONPATH
中并且,如果情况并非如此,请适当设置PYTHONPATH
。If you set just
PATH
instead ofPYTHONPATH
, my advice would be to check if the location of the module you want to import is in thePYTHONPATH
and, if that's not the case, set thePYTHONPATH
appropriately.