pythonpython-3.xmoduleiptc

Is there any Python3 compatible module to read/write IPTC-data?


I've already tried IPTCInfo3. But after successful installation with

pip3 install IPTCInfo

i get an import error:

Python 3.5.2 (default, Oct 11 2016, 04:59:56) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin

from iptcinfo import IPTCInfo

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: No module named 'iptcinfo'

Solution

  • pip install IPTCinfo is what you don't want - it's the python2 only package. What you linked to isn't on PyPI, but that doesn't mean you can't install it!

    Download the zip file from github, extract it, and in the resulting folder run: python setup.py install. I ran into an issue with the file naming, not sure if it was just a result of something I had done though - you can just open up setup.py and change py_modules=['iptcinfo3'], to py_modules=['iptcinfo'], if you get the same issue about there being no iptcinfo3 module.

    From there you should be able to import as you normally would. I just ran a command for it and it worked.