Use Exiftool with Python

Started by dannata_california, July 02, 2023, 12:58:25 PM

Previous topic - Next topic

dannata_california

Hi everyone,
I am an amateur user of python and I am trying to create a script that allows me to take a video, read the metadata, copy one attribute in another cyclically.

I have not been able to properly install Exiftool to use it with VSCodium.
Specifically, when I type "Import exiftool" I get the following error: ModuleNotFoundError: No module named 'exiftool'

I use Windows 10, I followed the steps described here https://exiftool.org/install.html for the stand-alone executable version.
Also from cmd I can correctly execute the exiftool command.

Could you please help me understand how I can use this powerful tool with python?

Thank you in advance

StarGeek

Exiftool, by itself, doesn't have a python module.

It looks like Import exiftool is used to load PyExiftool.  Do you have that installed and configured?  This link is to the newer fork, as the one Google shows first is a very older version :(

"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

dannata_california

Quote from: StarGeek on July 02, 2023, 01:51:24 PMExiftool, by itself, doesn't have a python module.

It looks like Import exiftool is used to load PyExiftool.  Do you have that installed and configured?  This link is to the newer fork, as the one Google shows first is a very older version :(



Yes, I have correctly installed pyexiltools but it still doesn't seem to work.

I better give up and try to make a script in powershell? :D

StarGeek

We can't really help much with an external library.  The fact that python is returning "ModuleNotFoundError" seems to indicate that the module isn't installed properly.  You might search search StackOverflow for some options, as there seems to be plenty of "ModuleNotFoundError" questions/answers.

Quote from: dannata_california on July 02, 2023, 03:13:40 PMI better give up and try to make a script in powershell? :D

It's up to you, but you need to know that Powershell works very poorly with exiftool. Commands that work pefectly well on CMD/Mac/Linux can fail with PS.  Recent Example.  Also, Powershell corrupts binary output, a common command with exiftool.
"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

dannata_california

Quote from: StarGeek on July 02, 2023, 04:15:30 PMWe can't really help much with an external library.  The fact that python is returning "ModuleNotFoundError" seems to indicate that the module isn't installed properly.  You might search search StackOverflow for some options, as there seems to be plenty of "ModuleNotFoundError" questions/answers.

Quote from: dannata_california on July 02, 2023, 03:13:40 PMI better give up and try to make a script in powershell? :D

It's up to you, but you need to know that Powershell works very poorly with exiftool. Commands that work pefectly well on CMD/Mac/Linux can fail with PS.  Recent Example.  Also, Powershell corrupts binary output, a common command with exiftool.

Thank you for your help, I will use CMD.