Jump to content

How to run Python3 from Alfred workflows

Recommended Posts

I'm trying to run a python3.7 script from a workflow (alfred4). The options only seem to contain the default python installation which is python2.7. Is there a way to run a python3.7 script?

Share this post

Link to post

Welcome @thebeardedberry,


By necessity, Alfred’s options only include what macOS ships. To run with a different executable, you have two options:

  • Set the language to External Script and point to the script with the correct shebang—must have the full path to the executable because Alfred’s environment isn’t the same as in your Terminal.
  • Set the language to /bin/bash and call Python version (again, full path) and then your script and arguments. Something like /usr/local/bin/python3.7 your-script.py argument.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...