请将所有出现的 "import gobject" 更改为 "from gi.repository import GObject"

Please change all occurrences of "import gobject" to "from gi.repository import GObject"

我尝试像这样导入 Gtk: from gi.repository import Gtk

我收到以下错误:

ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject"

当我尝试 from gi.repository import GObject

时出现同样的错误

请帮我解决这个问题!

我重新安装了 python-gobjectpython-gobject-2,现在一切正常!