PyCharm can not resolve PyGObject 3.0, but code runs fine

和自甴很熟 提交于 2019-11-28 05:55:21

In Gtk+ 3 Python bindings to binary modules are generated dynamically using *.typelib databases. The dynamic importer for accessing all the modules is located in gi.repository. PyCharm cannot detect these modules using its code insight, because they require special handling.

I've filed a feature request for this issue: PY-6932. Feel free to vote for it.

Sergey Solodukhin

Position the text cursor inside the redlined Gtk in:

from gi.repository import Gtk

hit Alt + Enter and choose "Generate stubs for binary module"

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