I've had exiftool installed in WSL for a bit. But this python script (https://github.com/PetrVys/MotionPhoto2) I need to convert Live Photos to Samsung Motion Photos is trying to "import exiftool" within python. Trying to run the script on WSL, it isn't detecting a thing.
I thought it might be some $PATH weirdness I'm not familiar with, so I tried the Windows option suggested by the Github repo, which is just using the Oliver Betz installer, which is very straightforward. Ran it and checked, I have exiftool on Windows now too. But running the script on Windows, it still says "exiftool" is not a Python library.
Is this a me problem? What am I missing?
Thank you.
ExifTool is Perl, not Python. You need a Python interface to run ExifTool from Python. Try this (https://github.com/sylikc/pyexiftool).
- Phil
Yes, that's what I was thinking. I wonder how exactly the author of the Github repo is using exiftool in this way...
Thanks for the help, and for this amazing library!
pyexiftool will be executing exiftool as an external command.
- Phil
The
import exiftool is importing the PyExiftool library that Phil linked to.
Just to verify, when installing the script, you did run the command to install the dependencies (https://github.com/PetrVys/MotionPhoto2?tab=readme-ov-file#dependencies).
The PyExiftool library uses exiftool's
-stay_open option (https://exiftool.org/exiftool_pod.html#stay_open-FLAG) to keep exiftool running in the background. This avoids Common Mistake #3 (https://exiftool.org/mistakes.html#M3) which can greatly impact the performance of exiftool
QuoteRunning as a single command is much faster because the startup time of loading ExifTool is significant