Running a Python shell script in Sequoia

I just upgraded from Catalina to Sequoia, and my macro that uses a Python shell script stopped working

The first line of the script is: #!/usr/bin/python
(I also tried: #!/usr/bin/python3)

The error message is: bad interpreter: No such file or directory

Maybe:

#!/Library/Frameworks/Python.framework/Versions/3.12/bin/python3

Works here in very limited ("hello world!") testing.

-rob.

Or just symbolic link that ugly path to /usr/bin/python—perhaps an easier and better solution!

-rob.

Depending on how you've done that you may or may not have python installed -- it isn't included in Sequoia, but may still be hanging around from a previous install.

Easy check -- in Terminal:

python3 --version

...will get you either a version number or a "command not found".

If you do need to install it, easy-mode is the Xcode Command Line Tools installer. You may even find that running the above command prompts you to install Tools and walks you through it. If not, run the following command:

xcode-select –-install

If you want to run the latest version of python your best bet is to install it with Homebrew -- here's two decent walk-throughs for installing first brew (if you haven't already): Install Homebrew · Mac Install Guide · 2025; and then python3: Brew Install Python · Mac Install Guide · 2025

1 Like