Why would a python3 script not find a module when run in Automator?

I am trying to automatically run a python script using automator. This script python3 ~/Desktop/python/gmaps.py works fine in terminal but not when I try to run it through Automator , I get a "module pyperclip cannot be found", even though it is found fine when running from terminal.

I can not figure out what would cause the path to be different. Is there a guide to command line plus Automator ?


Another option for running in automator without having to reinstall the module is to provide the path to the instance of python that you want used.

e.g. I used Homebrew to install python3 so I use the following in Automator to run that instance of python

/usr/local/Cellar/python/3.7.3/bin/python3

Source: VikingOSX reply here


Solved: I'm not sure why it worked, but running pip3 install pyperclip in the automator window installed it in the correct location for it to be used.