如何修复由于缺少"gi.repository"而导致的“无法导入:GTK +"错误? [英] How do I fix melds 'Cannot import: GTK+' error caused by missing 'gi.repository'?
本文介绍了如何修复由于缺少"gi.repository"而导致的“无法导入:GTK +"错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近开始学习GTK +开发并安装了一些新软件包(我不记得是哪个软件包).现在,合并工具meld
不再起作用:
I've recently started learning GTK+ development and installed some new packages (I don't remember which ones). Now the merge tool meld
doesn't work any more:
Cannot import: GTK+
No module named repository
这是由于Meld可执行文件的第155行引起的:
This is caused by line 155 of the meld executable:
from gi.repository import Gtk
请注意,我可以在Python 3中导入gi.repository
,但是将Meld转换为Python 3并不是那么简单.
Note that I can import gi.repository
in Python 3, but it is not so simple to convert meld to Python 3.
我该如何解决?
-
sudo apt-get install python-gobject
:已安装(源)
sudo apt-get install python-gobject
: Was already installed (source)
推荐答案
我有 gi
已安装软件包:
I had the gi
package installed:
$ sudo pip uninstall gi
解决了我的问题.
这篇关于如何修复由于缺少"gi.repository"而导致的“无法导入:GTK +"错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文