Closed logofun closed 3 years ago
Could not find exiv2.dll. It could be one of two cases :
Let's check the first case first. Please show what's in your directory:
C:\Python39\Lib\site-packages\pyexiv2\lib
the file(exiv2.dll) exist in the right way. How to check the problem via the 2rd case. thanks for your respond
Next, Try importing exiv2.dll in the Python interpreter:
>>> import ctypes
>>> ctypes.CDLL(r'C:\Python39\Lib\site-packages\pyexiv2\lib\exiv2.dll')
If it fails, it means exiv2.dll is not compatible with the computer.
oh no, the same wrong how can I do. My computer is surface pro with the windows10 system.
What kind of Python interpreter do you use? Only CPython supports importing C++ libraries.
>>> import platform
>>> platform.python_implementation()
'CPython'
In addition to compatibility, it could be for other reasons. You can try these: https://iyn.me/i/post-40.html https://stackoverflow.com/questions/59330863/cant-import-dll-module-in-python
It seems that the computer environment is the real reason. because when I use another PC and handle the program as the same way, it shows OK. by the way , I am using CPython in the both computer. Copy exiv2.dll from the github/LeoHsiao1/pyexiv2, it is not working. From the others methods, such as 'os.add_all_directory('....')',it's also wrong How to compile exiv2 manually?
I still think that exiv2.dll should be compatible with your computer, because your computer is not special.
Maybe you can try installing Python3.5 and then execute pip install pyexiv2
.
Finally, you can find the Exiv2 repository on GitHub, which is well documented.
I just tried using pyexiv2 on a newly installed Windows 10, it works:
C:\Users\Leo>python
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexiv2
the same version Python, One in the lenovo notebook computer, it's ok, just like your result. the other in Surface pro, it's also wrong
I found the answer. This is because the Windows computer lacks C++ environment. Please try to install Microsoft Visual C++ Redistributable for Visual Studio 2019.
This issue has been automatically closed because there has been no activity for a month.
when I install the module, and then import pyexiv2 , it show wrong(as the above picture)