Jump to content

Making Python 2 Workflows work on macOS Monterey 12.3 and above


Recommended Posts

With macOS Monterey 12.3, Apple removed the bundled Python 2 interpreter. That means older Workflows dependent on Python 2 will no longer work without modification.


You can reinstall Python 2, but some Workflows will still require a tweak to work. It’s simple enough to do if you know what to look for, but not everyone does. The Updated Third-Party Python 2 Workflows repository on GitHub is meant to close that gap.


Check the list of available Workflows. If the one you need isn’t present, ask for it there or as a reply on this thread. Be sure to include a link to the original.

 

Note this is only for Python 2 Workflows which break on Monterey 12.3 and above due to the Python 2 removal. If a Workflow stops working for any other reason, contact the author as usual.

Link to comment
  • vitor pinned this topic

Welcome @CatsAndCoffee

 

Can’t reproduce at all. Try downloading it again, it was updated recently.

 

11 hours ago, CatsAndCoffee said:

on an M1 Pro MacBook running Python 3 and monterey 12.3 (21E5206e)

 

It’s useful that you give the machine details, but the Python 3 part is irrelevant. For one, the point of these Workflows is that they have to use Python 2. If you haven’t followed the knowledge base article to install it, these won’t work. But no macOS machine comes with Python 3, so saying it’s running but not how it’s installed is insufficient information. Again, it doesn’t matter in this case, only pointing it out for future debugging.

Link to comment
8 hours ago, vitor said:

Welcome @CatsAndCoffee

 

Can’t reproduce at all. Try downloading it again, it was updated recently.

 

 

It’s useful that you give the machine details, but the Python 3 part is irrelevant. For one, the point of these Workflows is that they have to use Python 2. If you haven’t followed the knowledge base article to install it, these won’t work. But no macOS machine comes with Python 3, so saying it’s running but not how it’s installed is insufficient information. Again, it doesn’t matter in this case, only pointing it out for future debugging.

thanks for your reply, @vitor.

eventually, i found out what was going wrong:

image.thumb.png.20ed21acb5d1acf9f9d755131f3921b5.png

 

in line 670, the workflow is trying to fetch currency data with `/usr/bin/python`, which no longer exists in the latest macOS beta.

i fixed it by simply changing the path to my `/opt/homebrew/bin/python`.

Edited by CatsAndCoffee
Link to comment
8 minutes ago, CatsAndCoffee said:

in line 670, the workflow is trying to fetch currency data with `/usr/bin/python`

 

Missed that one. Now fixed the repo in the Workflow.

 

9 minutes ago, CatsAndCoffee said:

i fixed it by simply changing the path to my `/opt/homebrew/bin/python`.

 

Just python works and will avoid the same issue in the future (or if you install the Workflow on an Intel machine).

Link to comment
  • 2 weeks later...
  • 2 weeks later...

Do we know if / when Alfred will be removing (or maybe allowing editing of the list) within the Script Filters intepreter options?

 

`/usr/bin/python` is now showing as not installed (obviously) and although I have python3 installed via brew, and available at `/usr/bin/python3` - I obviously cannot select it or use it easily.

Edited by MrStreeter
Link to comment
4 hours ago, pankajsz said:

 

Added.

 

16 minutes ago, MrStreeter said:

or maybe allowing editing of the list

 

Editing the list isn’t very useful, because your changes won’t propagate to other people and they may not have whatever runtime you’ve added. It could cause hard-to-diagnose problems when sharing Workflows.

 

18 minutes ago, MrStreeter said:

I obviously cannot select it or use it easily.

 

Save your script inside the Workflow with a proper shebang (#!/usr/bin/python3) and call it as an External Script as the Language. Or use /bin/zsh as the Language and call your script with /usr/bin/python3 SCRIPT_NAME. You were never limited by the languages in the dropdown, you can easily use anything on your system.

Link to comment
2 minutes ago, vitor said:

Save your script inside the Workflow with a proper shebang (#!/usr/bin/python3) and call it as an External Script as the Language. Or use /bin/zsh as the Language and call your script with /usr/bin/python3 SCRIPT_NAME. You were never limited by the languages in the dropdown, you can easily use anything on your system.

 

This is what I ended up doing. Thanks for confirming.

 

Not sure why i never did it this way to begin with, its a lot easier/nicer to be able to handle a script in an IDE than a text box!

Link to comment
4 hours ago, vitor said:

 

Added.

 

 

Editing the list isn’t very useful, because your changes won’t propagate to other people and they may not have whatever runtime you’ve added. It could cause hard-to-diagnose problems when sharing Workflows.

 

 

Save your script inside the Workflow with a proper shebang (#!/usr/bin/python3) and call it as an External Script as the Language. Or use /bin/zsh as the Language and call your script with /usr/bin/python3 SCRIPT_NAME. You were never limited by the languages in the dropdown, you can easily use anything on your system.

 

https://github.com/deanishe/alfred-appscripts. - pls post an update for this. General guidelines on how to fix Python2 issue would be great. thanks in advance

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...