How to resolve these unresolved imports in PyDev ( eclipse )?

北战南征 提交于 2020-01-06 09:55:10

问题


I get unresolved imports for these,

from gi.repository import GLib, GObject, Gio
from gi.repository import Dee
from gi.repository import Unity

I've been learning to write lens for unity(ubuntu). Where/How to get these modules and link them?


回答1:


Are those in your PYTHONPATH? Have you tried adding 'gi' to the forced builtins? See: http://pydev.org/manual_101_interpreter.html for details.




回答2:


Right click on the project node and choose Properties. Choose PyDev - PYTHONPATH and the External Libraries tab. Press Add source folder and add the directory above the one that contains your gi package. That is, if you have /src/gi/repository you should add /src.



来源:https://stackoverflow.com/questions/11098483/how-to-resolve-these-unresolved-imports-in-pydev-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!