我剛剛爲我的debian machiene編譯了exiv2和gexiv2,現在我想開始使用gexiv2來使用python編輯IPTC數據。該gexiv2網站介紹下面的代碼行:如何在python中使用gexiv2?
from gi.repository import GExiv2
但已經導致:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gi.repository
我甚至不能進口GI所以我覺得我失去了另一個包!?我需要做些什麼才能按預期完成此項工作?
更新:我將我的操作系統升級到最新的debian版本。我現在可以導入gi,但我仍然無法使用GExiv2。
以下錯誤導入GExiv2時出現:
>>>from gi.repository import GExiv2
ERROR:root:Could not find any typelib for GExiv2
對於我解決了這個問題,它的工作手動安裝來自Ubuntu的['gir1.2-gexiv2'](http://packages.ubuntu.com/raring/amd64/gir1.2-gexiv2-0.4/download)軟件包(我使用的是Debian sid)。 – Christoph