use*_*166 7 python gobject repository nautilus
我正在尝试在Ubuntu 10.04上启动python脚本:
from gi.repository import Nautilus, GObject
它不起作用:
Traceback (most recent call last):
File "script.py", line 1, in <module>
from gi.repository import Nautilus, GObject
ImportError: No module named gi.repository
Run Code Online (Sandbox Code Playgroud)
我安装了python-gobject-dev,python-gobject,python-nautilus,但它没有帮助.有谁有这个问题?
尝试通过安装PyGObject来修复它:
# With Apt on Ubuntu:
$ sudo apt install python3-gi
# With Yum on CentOS / RHEL:
$ sudo yum install python36-gobject.x86_64
# Or directly with Pip:
$ pip3 install PyGObject
Run Code Online (Sandbox Code Playgroud)
10.04?那是 GNOME 3 之前的版本,因此首选的 Python 绑定基于 PyGTK,而不是 PyGObject。您需要使用(过时的)PyGTK 绑定或升级到较新的操作系统。