LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
196 stars 39 forks source link

Cannot import name 'ImageMetadata' from 'pyexiv2' #97

Closed estribiyo closed 1 year ago

estribiyo commented 1 year ago

I have this output when trying to import the library as original pyexiv2...

The code I use in Python 3.9 running on Windows 10 is:

from pyexiv2 import ImageMetadata, xmp, XmpTag, IptcTag, ExifTag
LeoHsiao1 commented 1 year ago

Hi, you might be confused with these similar projects:

estribiyo commented 1 year ago

Well, since pyexiv2 where installed via pip:

pip install pyexiv2

After trying py3exiv2, that it's very difficult to compile under Windows and other library alternatives like a combination of iptcinfo3, exif, libxmp, ... (that have problems with GPS points). Seeing that your library it's using the original library name, I suposed that yours was a sucessor of pyexiv2... but looking the documentation I see that is an implementation that has nothing to do with the original one.

estribiyo commented 1 year ago

Currently I'm recoding my software to use your library.

I hope all issues with other libraries above mentioned are working... (gps, exif thumbnail, ...).

At the moment I confirm you that installation on Python 3.9 and Windows 10 is easy (fo further steps or external compilations) and works fine.

Thank you!

LeoHsiao1 commented 1 year ago

This project provides some precompiled packages that you can install with pip3 install pyexiv2. On Windows computers, the command pip is usually linked to pip3. On CentOS computers, the command pip is usually linked to pip2.

estribiyo commented 1 year ago

I know... in fact, the main problem with py3exiv2 is exiv2.dll, it's not packaged with the library... and their compilation under Windows is a pain in the ass. Besides, the author seems to have the project half abandoned, or doesn't care if it works on Windows or Mac... only compiles on Linux or must modify the setup.py to adapt it to these platforms.

Python End Of Life was 01 Jan 2020, CentOS is a little behind... :D

I've tested GPS and some basic functionalities... it seems to work pretty good. Thank you for your work.