Python script using exiftool cannot detect it

Started by prox, December 14, 2024, 06:05:56 AM

Previous topic - Next topic

prox

I've had exiftool installed in WSL for a bit. But this python script 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.

Phil Harvey

ExifTool is Perl, not Python.  You need a Python interface to run ExifTool from Python.  Try this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

prox

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!

Phil Harvey

pyexiftool will be executing exiftool as an external command.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

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.

The PyExiftool library uses exiftool's -stay_open option to keep exiftool running in the background. This avoids Common Mistake #3 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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype