6

I just compiled exiv2 and gexiv2 for my debian machiene and now I want to start working with gexiv2 to edit IPTC data using python. The gexiv2 website presents the following line of code:

from gi.repository import GExiv2

But that already results in:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named gi.repository

I can't even import gi so I think I'm missing another package!? What do I have to do to make this work as expected?

UPDATE: I upgraded my OS to the newest debian version. I can import gi now, but I'm still having trouble with GExiv2.

The following error occurs when importing GExiv2:

>>>from gi.repository import GExiv2
ERROR:root:Could not find any typelib for GExiv2
JasonTS
  • 2,479
  • 4
  • 32
  • 48
  • For me it worked to manually install the [`gir1.2-gexiv2`](http://packages.ubuntu.com/raring/amd64/gir1.2-gexiv2-0.4/download) package from Ubuntu (I'm using Debian sid). – Christoph Nov 05 '13 at 10:47

3 Answers3

4

Hi i had the same problem i fixed it by installing gir1.2-gexiv2-0.4

Foo Bar User
  • 2,401
  • 3
  • 20
  • 26
1

I believe the package you need is python3-gi or, if you're using Python 2, python-gi.

nemequ
  • 16,623
  • 1
  • 43
  • 62
  • that doesn't exist in my repo. according to the debian website it contains pygi wich is depricated and should be part of gobject now, but i already installed gobject. – JasonTS Oct 05 '13 at 09:39
  • Both packages exist for current stable (wheezy). I'll add links. – nemequ Oct 05 '13 at 16:54
  • 1
    I upgraded to the newest debian version, but now I'm getting this Error: ERROR:root:Could not find any typelib for GExiv2 – JasonTS Oct 09 '13 at 23:13
  • Does `$(pkg-config --variable=typelibdir gobject-introspection-1.0)/GExiv2.typelib` exist? Looking at the libgexiv2 packages on packages.debian.org, it seems like their Debian packages are broken and include neither the GIR nor typelib, which means you should file a bug and, if you want to get it working ASAP, install libgexiv2 from source, circumventing debian's package management system. – nemequ Oct 10 '13 at 19:01
  • If I type the line you gave me in a console I get: "/usr/lib/girepository-1.0/GExiv2.typelib: No such file or directory". I tried compiling it myself, but having two versions leads to other problems. How can I swap the debian version with my own? I can't just aptitude uninstall it, becaus then it wants to remove gnome, too. I'd also love to file it, but I really don't know how. The reportbug tool of debian is really shitty, because it asks a lot of stuff a novice like me doesn't know. – JasonTS Oct 13 '13 at 16:50
0

Same problem here, I solved it by installing gir1.2-gexiv2-0.4 AND python-gobject

jesjimher
  • 1,175
  • 1
  • 12
  • 17