Python 3; pyexiv2 v.2.7 can't load exiv2.dll, although it's there

171 Views Asked by At

Encountering an JPG image which wouldn't load with pyexiv2 v2.6.4, I upgraded to pyexiv2 v2.7, via pip install, which went through without complaints.

Now pyexiv2 doesn't load at all anymore, complaining

FileNotFoundError: Could not find module 'C:\Program Files\Python\3.8\lib\site-packages\pyexiv2\lib\exiv2.dll'. Try using the full path with constructor syntax.

The file exists (os.path.exists("...")==True just before the _dlopen() throwing the exception), and was just installed fresh with the package. I am running "Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32".

Any ideas? Thanks!

EDIT: Two more bits of information:

  • I vaguely remember that when installing the previous pyexiv2 version, the installation compiled something called exiv2. This did not happen during installing pyexiv2 v2.7. Although I do find only the windows subdirectories in the install directory.

  • Replacing v2.7 by v2.6.4 again (from a safety copy :-) does not help - now it's broken as well :-(

1

There are 1 best solutions below

0
On

Looking at Python docs for the ctypes module, I saw a hint that maybe it's a problem with additional libraries required by exiv2.dll.

After installing "Visual Studio 2022 Release Candidate" from Visual Studio Download (be sure to check the "build tools" checkbox when the installer asks for what to install), all is well again.