0
votes

I know this has been asked many different ways before but I can't seem to find anything that works.

I have an automator task that runs a python script (v3.7 via homebrew) that imports the package guessit (v3) from an automator shell script (/bin/zsh) in OS Catalina. I have the output of the script set to echo to a log that the automator task creates. I've been able to cut down the python script to just this to exhibit the problematic behavior:

from guessit import guessit
print("hello world")
  • As is, the automator log output is blank (I'm guessing the script fails, but the error is hidden. Additional shell echos after the script's execution still show up in the log)
  • If I remove the import, I get "hello world" in the automator log.
  • If I run the python script from terminal including the import, I get "hello world" in terminal.
  • If I run the automator task with the import, as /bin/sh, and in OS Mojave, I get "hello world" in the automator log.

This leads me to believe that there is an issue with the PATH in my automator script that changed when I upgraded to Catalina and/or zsh.

Thanks for the help!

1

1 Answers

0
votes

I included my PATH at the top of my shell script and the simple import worked as expected. While testing, I compared the output of echo $PATH to the same $PATH in automator. Automator's $PATH was only /usr/local/bin while my terminal $PATH included other entries, like homebrew's install directory. I added terminal's output to the top of my automator shell script:

PATH="/usr/local/Cellar/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH"