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

标签 python python-2.7 ubuntu gtk gobject

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

我收到以下错误:

ImportError:当使用 gi.repository 时,您不能导入像“gobject”这样的静态模块。请将所有出现的“import gobject”更改为“from gi.repository import GObject”

当我尝试 from gi.repository import GObject

时,我遇到了同样的错误

请帮我解决这个问题!

最佳答案

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

关于python - 请将所有出现的 "import gobject"更改为 "from gi.repository import GObject",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36247420/

相关文章:

python - 在列表列表中的每第 n 个位置插入元素

python - 属性错误: module 'keras.backend' has no attribute 'set_image_dim_ordering'

python - 无法使用 pip Python 2.7 安装 aws-sam-cli

python-2.7 - 运行 Python 脚本以从 MSBuild 进行部署

python - 使用 Python/PIL 从图像中删除背景颜色

linux - 如何编译GTK2源代码?

python - Pandas :根据开始/结束日期聚合

linux - Django celery socket.error : [Errno 111] Connection refused

python - 如何通过 Mininet 主机运行 python 脚本?

python - 使用 scikit-learn 的顺序 k-means 聚类