我从OSGeo4W包中安装了QGIS,它还包括Python2.7和许多用于Python的空间库。
在Windows 7中设置了以下环境变量:
Path = [...];C:\OSGeo4W\bin
PYTHONPATH = C:\OSGeo4W\apps\python27\lib;
C:\OSGeo4W\apps\qgis\python;
C:\Users\username\.qgis\python;
C:\Users\username\.qgis\python\plugins;
C:\OSGeo4W\apps\qgis\python\plugins;
C:\OSGeo4W\apps\python27\DLLs;
C:\OSGeo4W\apps\qgis\bin;
C:\OSGeo4W\apps\python27\lib\site-packages;
C:\OSGeo4W\apps\qgis\python\plugins\fTools;当从C:\OSGeo4W\bin\python.exe执行W7或仅仅从W7 CLI执行python (因为它得到正确的解析)时,我可以导入诸如import pyspatialite之类的东西,没有问题,所以我假设PYTHONPATH是正确设置的。
但是,当试图在PyDev中添加Python解释器时,我会得到以下错误:
Error getting info on interpreter: See error log for details.
No output was in the standard output when trying to create the interpreter info.
The error output contains:>>ImportError: No module named site<<就好像PyDev不认识PYTHONPATH。此外,在“库”-Tab下,我没有看到任何条目(这再次暗示PyDev不承认PYTHONPATH)。
我已经重新启动了Eclipse,但没有成功。
更新:重新启动整个系统。天哪,我们还住在90年代。
发布于 2013-03-02 17:51:18
重新启动整个W7系统起到了帮助作用。就像回到Windows时代一样。
https://stackoverflow.com/questions/15177149
复制相似问题