How to use gexiv2 in python?
Asked Answered
C

3

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
Co answered 3/10, 2013 at 4:43 Comment(1)
For me it worked to manually install the gir1.2-gexiv2 package from Ubuntu (I'm using Debian sid).Recollected
D
4

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

Detainer answered 1/2, 2014 at 13:28 Comment(0)
S
1

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

Suprasegmental answered 4/10, 2013 at 19:57 Comment(5)
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.Co
Both packages exist for current stable (wheezy). I'll add links.Suprasegmental
I upgraded to the newest debian version, but now I'm getting this Error: ERROR:root:Could not find any typelib for GExiv2Co
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.Suprasegmental
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.Co
B
0

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

Bruce answered 24/3, 2014 at 13:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.