Executing ExifTool in Anaconda (Python) with MicaSense sensor

Started by Student14, June 27, 2022, 11:16:41 AM

Previous topic - Next topic

Student14

Hello,

Please excuse my tech grammar, I'm new to coding and forums. I'm using the ExifTool to process imagery collected by the MicaSense dual camera system (10 bands). I have successfully downloaded the ExifTool and used it in a previous script to write the metadata needed to correct each image for roll, pitch, yaw, and orientation, etc. I'm now working through the radiometric correction workflow provided by MicaSense (https://micasense.github.io/imageprocessing/MicaSense%20Image%20Processing%20Tutorial%201.html). I hit an error in [3]: Import micasense.metadata as metadata. The error reads "ModuleNotFoundError: No module named 'exiftool'." I also triple checked I setup exiftool properly following these instructions https://micasense.github.io/imageprocessing/MicaSense%20Image%20Processing%20Setup.html. What am I missing?

Any advice is much appreciated. Thank you.

StarGeek

It most likely that exiftool isn't in the PATH env variable as seen by your program.

Try setting the part that says
exiftoolPath = None
to the full path to exiftool.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

TClarke2

I am having a similar issue with micasense codes for their tutorial at least. When I import exiftool on Jupyter notebook is says no module names exiftool. I am using macOS Sonoma on an M1 Pro.

I saw on another section to change 'import exiftool' to 'import /usr/local/bin/exiftool' that was unsuccessful as well.

import cv2 #openCV
import exiftool
import os, glob
import numpy as np
import pyzbar.pyzbar as pyzbar
import matplotlib.pyplot as plt
import mapboxgl

print()
print("Successfully imported all required libraries.")
print()

if os.name == 'nt':
    if os.environ.get('exiftoolpath') is None:
        print("Set the `exiftoolpath` environment variable as described above")
    else:
        if not os.path.isfile(os.environ.get('exiftoolpath')):
            print("The provided exiftoolpath isn't a file, check the settings")

try:
    with exiftool.ExifTool(os.environ.get('exiftoolpath')) as exift:
        print('Successfully executed exiftool.')
except Exception as e:
    print("Exiftool isn't working. Double check that you've followed the instructions above.")
    print("The execption text below may help to find the source of the problem:")
    print()
    print(e)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[7], line 2
      1 import cv2 #openCV
----> 2 import exiftool
      3 import os, glob
      4 import numpy as np

ModuleNotFoundError: No module named 'exiftool'

StarGeek

Whatever this exiftool module is (Python? PyExiftool?), it was not created by Phil, the author of exiftool. You'll have to look elsewhere for support on this.

That said, doing a quick search on "micasense codes tutorial" leads me to this page, which indicates you have to install PyExiftool.  The error that it isn't found seems to indicate that you haven't installed it, though I don't know Python and don't know its error responses.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

TClarke2

Quote from: StarGeek on April 21, 2024, 10:29:25 AMWhatever this exiftool module is (Python? PyExiftool?), it was not created by Phil, the author of exiftool. You'll have to look elsewhere for support on this.

That said, doing a quick search on "micasense codes tutorial" leads me to this page, which indicates you have to install PyExiftool.  The error that it isn't found seems to indicate that you haven't installed it, though I don't know Python and don't know its error responses.

That is the micasense/github page I have been following the tutorial of. They have a link which brought me to the exiftool website to download the dmg from. I've installed the PyExiftool already. Not sure where else to turn since Micasense went out of business their Github page in no longer being supported or supported anywhere near as well as this forum unfortunately.

StarGeek

You might try looking for help on a site that deals with Python. The error seems to indicate that Python can't find PyExiftool.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).