IPTCInfo on Python 3.x Windows

1k views Asked by At

I need to extract IPTC metadata from images. Most of the things I've read about Python packages on Windows suggest using pre-compiled binaries, but I don't see one for IPTCInfo, thus I tried pip3.

I'm getting an error from pip when trying to install this:

C:\Users\hackr>pip3 install IPTCInfo
Collecting IPTCInfo
  Downloading IPTCInfo-1.9.5-6.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo\setup.py", line 32
        print self.get_archive_files()
                 ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo

So, I tried to open that last temporary file it refrences, but it doesn't appear to exist...

2

There are 2 answers

0
Andy Trawick On BEST ANSWER

I have the same problem. Appears the IPTCinfo is for python-2. I will upgrade IPTCinfo for python-3.

However I have found the library exvi2 which provides the same type of image support. There is a python interface for this at https://wiki.gnome.org/Projects/gexiv2

0
james-see On

I maintain IPTCInfo3 in Pypi. I recommend downloading it via pip3 install iptcinfo3 as it is specifically upgraded for Python3x. Follow the readme and issue comments for examples. Enjoy.