Jump to content

How to convert Python 2 workflows to Python 3


Recommended Posts

I upgraded to Monterey and like many people, my workflows broke because they rely on Python 2. I know how to install Python 2 with Homebrew, but that's not my goal. My goal is to use Python 3 instead. But how do I do that? The Alfred Workflow "Run Script" action has a "Language" dropdown with a fixed set of choices, not including /usr/bin/python3. How can I tell Alfred to use /usr/bin/python3 for the "Run Script" action?

 

image.png.24b26f05ca6018ecaba22511871d8ea1.png

 

Link to comment

Thanks, I was afraid that was the answer. Saving my script as a separate file is fine, but less convenient than typing the script directly into the "Run As" dialog. It seems like the "language" dropdown should be configurable, especially since some of its options (like /usr/bin/python) are now obsolete.

Link to comment

@macsorcery Alfred doesn't bundle scripting languages (and didn't bundle Python 2 in the past); It uses the ones made available by macOS or that you've installed yourself.

 

There are instructions on reinstalling Python 2 here, as most workflows are being tweaked to use the new location where Python 2 is located on your Mac:

https://www.alfredapp.com/help/kb/python-2-monterey/

 

Alternatively, some workflow creators are opting to move away from Python altogether and rewriting their workflows using other scripting languages that are built into Alfred and don't require any setup in this respect. :)

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...