stand Alone MAC app using python

Started by bhuish, September 07, 2016, 03:46:49 PM

Previous topic - Next topic

bhuish

I developed a Python script using exiftool (pyexiftool) and it works great but when I try to create the standalone mac app I get the following error, "ImportError: No module named exiftool".   The python script works great from the terminal window on my mac.  I am using py2app to build the stand-alone app.  The build directory is created as is the dist directory but when I try to run the app from terminal I get the error.  What do I need to do to get this thing to recognize where exiftool is hiding on my mac??? .  When I open the Contents of the dist dir I can see the Python library but the exiftool library is nowhere to be found in either resources or lib.   Help...  I suspect there is an easy fix but it is baffling me..... The import in the Python script is   "import exiftool"  and it works fine when just running the python script.   Thanks

Phil Harvey

The ImportError is a Python error, so it isn't finding the pyexiftool module.  Likely the Python include directories are different when you create a standalone app.  I don't know Python so I can't help much here, but you should be able to figure this out with a bit of googling.  Maybe as simple as "import /path/to/exiftool"?

- 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 ($).

bhuish

Thanks for your thoughts. My thought as well.  I was going to try this but I can't seem to find the path to pyexiftool.  Apparently these paths are a mystic secret in a Mac, buried in invisible directories.  If anybody can provide the Mac pathway to pyexiftool on Mac I would be very appreciative.  Once I have that I face the daunting syntax perils.  :-\
Thanks

bhuish

OK.... I got it to accept exiftool by putting exiftool the executable (MAC) in the directory where everything lives.  It works fine but when I try to build a stand alone using py2app it cannot find pyexiftool / exiftool again.  The script works fine, the alias from Py2app works fine but the full compile keeps giving me file or directory no found... help

Stephen Marsh

https://exiftool.org/forum/index.php/topic,7576.0.html