Fails to same Python script from Terminal/Automator/Script Editor

Hi, I want to make a button on the menubar to run a Python script I made. To achieve that I thought to use Automator or Script Editor, but:

If I run the script on Terminal manually, all fine. (cd path/to/script && python3 myscript.py)

If I run exactly the same code in brackets using Automator shell function or Apple Script, they give me an error of a Python module not installed (but it's installed, I'm sure it is)

Any idea?

MacBook Pro 13″, macOS 11.4

Posted on Jun 13, 2021 8:05 AM

Reply
9 replies

Jun 13, 2021 9:10 AM in response to ileonemil

You didn't follow the example exactly as your Passa a input: is set to come stdin, not as arguments. You will need to change that so you can pass the results from the previous action into your Python3 script code as sys.argv[1]. The only purpose of my example was to confirm the path to the Python3 (3.9.5) library.


What is the file that you have selected? Is it a Python module of some kind?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Fails to same Python script from Terminal/Automator/Script Editor

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.