Automator giving me an error "Could not find shell /usr/local/bin/python"

I think this error has occurred since installing ventura. I didn't create this automator but use it often for my workflow, so I really need to fix it!


When I run the automator I get this error:


The action "Run Shell Script" encountered an error: "Could not find shell /usr/local/bin/python. You might need to install it."


Can anyone walk me through how to fix this?

MacBook Pro 16″, macOS 13.1

Posted on Feb 28, 2023 12:41 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 1, 2023 3:13 AM

VikingOSX wrote:

Apple removed the default Python (python 2.7.16) distribution beginning with macOS 12.3 and that broke some of their own solutions (Automator PDF Watermark), and a good deal number of user scripts.

If you install Python3 (e.g. 3.11.2) from Python.org, the Python3 will be found in /usr/local/bin/python3 (a link) and on Automator's Run Shell Script Shell: menu at the same location. Installing the Command Line Tools for Xcode does not place /usr/bin/python3 on that Automator Run Shell Script menu, and one would have to use that location in a Python3 HERE script, which is more complicated…

The Python3 installation from Python.org installs just a fraction of the 3+ GB storage used by the Command Line Tools for Xcode and that Xcode-select --install process.

There is also the possibility that code that references Python2 (e.g. python) may not be compatible with the changes in the Python3 library or Python3 syntax requirements.


While the command line tools includes tools in addition to python3 (i.e gcc), python.org handles macOS updates by not removing the prior versions and I’m left with multiple versions in my App Folder, and in Frameworks. And I only occasionally use python and only with the command line, so IDLE is of no use for me.


The command line tools is an older version (3.9.6) than python.org (3.11.2)

The command line tools python is installed at:

macbook-air:~ Tony% where python3
/usr/bin/python3
/Library/Developer/CommandLineTools/usr/bin//python3


While Automator doesn't reference /usr/bin/python3 in the Run Shell Script menu (but does in Shortcuts, go figure) I had no issues with the Automator Watermark Action once I set up a new workflow (my old workflow didn't convert to Ventura):




Shortcuts:

5 replies
Question marked as Top-ranking reply

Mar 1, 2023 3:13 AM in response to VikingOSX

VikingOSX wrote:

Apple removed the default Python (python 2.7.16) distribution beginning with macOS 12.3 and that broke some of their own solutions (Automator PDF Watermark), and a good deal number of user scripts.

If you install Python3 (e.g. 3.11.2) from Python.org, the Python3 will be found in /usr/local/bin/python3 (a link) and on Automator's Run Shell Script Shell: menu at the same location. Installing the Command Line Tools for Xcode does not place /usr/bin/python3 on that Automator Run Shell Script menu, and one would have to use that location in a Python3 HERE script, which is more complicated…

The Python3 installation from Python.org installs just a fraction of the 3+ GB storage used by the Command Line Tools for Xcode and that Xcode-select --install process.

There is also the possibility that code that references Python2 (e.g. python) may not be compatible with the changes in the Python3 library or Python3 syntax requirements.


While the command line tools includes tools in addition to python3 (i.e gcc), python.org handles macOS updates by not removing the prior versions and I’m left with multiple versions in my App Folder, and in Frameworks. And I only occasionally use python and only with the command line, so IDLE is of no use for me.


The command line tools is an older version (3.9.6) than python.org (3.11.2)

The command line tools python is installed at:

macbook-air:~ Tony% where python3
/usr/bin/python3
/Library/Developer/CommandLineTools/usr/bin//python3


While Automator doesn't reference /usr/bin/python3 in the Run Shell Script menu (but does in Shortcuts, go figure) I had no issues with the Automator Watermark Action once I set up a new workflow (my old workflow didn't convert to Ventura):




Shortcuts:

Mar 1, 2023 12:25 AM in response to umagurl77

Apple removed the default Python (python 2.7.16) distribution beginning with macOS 12.3 and that broke some of their own solutions (Automator PDF Watermark), and a good deal number of user scripts.


If you install Python3 (e.g. 3.11.2) from Python.org, the Python3 will be found in /usr/local/bin/python3 (a link) and on Automator's Run Shell Script Shell: menu at the same location. Installing the Command Line Tools for Xcode does not place /usr/bin/python3 on that Automator Run Shell Script menu, and one would have to use that location in a Python3 HERE script, which is more complicated…


The Python3 installation from Python.org installs just a fraction of the 3+ GB storage used by the Command Line Tools for Xcode and that Xcode-select --install process.


There is also the possibility that code that references Python2 (e.g. python) may not be compatible with the changes in the Python3 library or Python3 syntax requirements.

Mar 1, 2023 5:39 AM in response to Tony T1

In Ventura, Apple has rewritten the Automator Watermark PDF Documents action in Swift and CoreGraphics, so there is no surprise that it just works now.


I have no issues with current Python.org installations. That is why I use virtual environments as some third-party modules are not fully compatible with the latest Python3 version.


I have been installing the Xcode Command Line tools for a long while so I know what is in it, and my use of it is more for Swift and Objective-C than an outdated Python3. Especially since Apple trashed the scripting bridge in their version of Python3.


I realize that Shortcuts is the future direction, and I have posted using that solution lately. It is an acquired taste and the implementation for the average user is not as straightforward as it might be for us.

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.

Automator giving me an error "Could not find shell /usr/local/bin/python"

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