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

libexiv2.dylib' (no such file) #94

Closed zkendall closed 2 years ago

zkendall commented 2 years ago

I get this error when trying to import Image from the library.

I have Version: 2.5.0 of pyexiv2, and python 3.8. I'm on a MBP with Apple M1 Pro chip if that matters.

(.venv) zkendall@Zacks-MacBook-Pro ~/p/file_scripts [0|1]> /Users/zkendall/projects/file_scripts/.venv/bin/python /Users/zkendall/projects/file_scripts/file-dates.py
Traceback (most recent call last):
  File "/Users/zkendall/projects/file_scripts/file-dates.py", line 6, in <module>
    from pyexiv2 import Image as ImgMeta
  File "/Users/zkendall/projects/file_scripts/.venv/lib/python3.8/site-packages/pyexiv2/__init__.py", line 6, in <module>
    from .core import *
  File "/Users/zkendall/projects/file_scripts/.venv/lib/python3.8/site-packages/pyexiv2/core.py", line 1, in <module>
    from .lib import exiv2api
  File "/Users/zkendall/projects/file_scripts/.venv/lib/python3.8/site-packages/pyexiv2/lib/__init__.py", line 25, in <module>
    ctypes.CDLL(os.path.join(lib_dir, 'libexiv2.dylib'))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/zkendall/projects/file_scripts/.venv/lib/python3.8/site-packages/pyexiv2/lib/libexiv2.dylib, 0x0006): tried: '/Users/zkendall/projects/file_scripts/.venv/lib/python3.8/site-packages/pyexiv2/lib/libexiv2.dylib' (no such file)

(.venv) zkendall@Zacks-MacBook-Pro ~/p/file_scripts [0|1]> pip install pyexiv2
Requirement already satisfied: pyexiv2 in ./.venv/lib/python3.8/site-packages (2.5.0)
LeoHsiao1 commented 2 years ago

Hi. When you execute pip install pyexiv2, it will try to download the pyexiv2 and exiv2 compilation files. However, both exiv2 and pyexiv2 are compiled using Github Action for amd64 architecture only. So, you need git clone exiv2 and pyexiv2, then compile them manually. See pyexiv2/lib.

LeoHsiao1 commented 2 years ago

Although I wanted to avoid the compile time for users, I didn't have a trusted ARM computer. Maybe Github Action will offer one in the future.