You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alfred-Workflow is targeted at the system Python on macOS. Its goal is to enable developers to build workflows that will “just work” for users on any vanilla installation of macOS since Snow Leopard.
Yeah, well, for some time it's been obviously that Python2 was going away. For it to "just work" now, it needs python 3 support.
Now you can use "python filename.py" to run your python2 file in the macOS terminal.
You can also run your python2 code in the Alfred Script Filter.
But if you use bash to run your python2 file in Alfred, you need to do one more thing.
Change your bash command in your workflow configuration from: python filename.py "{query}"
to: ${HOME}/.pyenv/versions/2.7.18/bin/python filename.py "{query}"
If you don't do this you will get an error report by Alfred debugger which is "/bin/bash: python: command not found"
moneygalaxy, raingao, wisinfun, fedorpashin, dzucon and 8 morecraffolocraffolocraffolo
Alfred-Workflow is targeted at the system Python on macOS. Its goal is to enable developers to build workflows that will “just work” for users on any vanilla installation of macOS since Snow Leopard.
Yeah, well, for some time it's been obviously that Python2 was going away. For it to "just work" now, it needs python 3 support.
I agree with you, the sentence you quoted is ridiculous. Even if the developers stick to their views, they should be prepared for python3 in another branch. "just work" can become "just not work" in one night, now, it happens and no official "just work" solutions.
Now you can use "python filename.py" to run your python2 file in the macOS terminal. You can also run your python2 code in the Alfred Script Filter.
But if you use bash to run your python2 file in Alfred, you need to do one more thing. Change your bash command in your workflow configuration from: python filename.py "{query}" to: ${HOME}/.pyenv/versions/2.7.18/bin/python filename.py "{query}" If you don't do this you will get an error report by Alfred debugger which is "/bin/bash: python: command not found"
and you should replace '/usr/bin/python' -> '/usr/local/bin/python' in /workflow/background.py
Activity
fedecalendino commentedon Mar 14, 2022
I think Apple finally removed python2.7 from macOS since the command
python
cannot be found by Alfred.edit: Migrating the workflow library with2to3
and usingpython3
in my Script Filters, did the trick to revive my workflows: https://github.com/fedecalendino/alfred-workflow/commit/650e193cda80e3fe16cb7fcbfa805e71371f6d93Although they are quite simple, so it might not work for everyone as well.psifertex commentedon Mar 15, 2022
It's especially ironic given the text:
Yeah, well, for some time it's been obviously that Python2 was going away. For it to "just work" now, it needs python 3 support.
at the bottom of https://www.deanishe.net/alfred-workflow/supported-versions.html#why-no-python-3-support
psifertex commentedon Mar 15, 2022
For anyone else in the same boat, might want to check out this fork: https://github.com/NorthIsUp/alfred-workflow-py3
(found via the pinned issue: #97)
moneygalaxy commentedon Mar 16, 2022
macOS has removed the python2.7. You need to follow the steps to solve your problem:
First, you need to reinstall Python 2. To do so, install Homebrew then run the following in a terminal:
Now you can use "python filename.py" to run your python2 file in the macOS terminal.
You can also run your python2 code in the Alfred Script Filter.
But if you use bash to run your python2 file in Alfred, you need to do one more thing.
Change your bash command in your workflow configuration from:
python filename.py "{query}"
to:
${HOME}/.pyenv/versions/2.7.18/bin/python filename.py "{query}"
If you don't do this you will get an error report by Alfred debugger which is "/bin/bash: python: command not found"
xavdid commentedon Mar 17, 2022
Here's Apple's release notes on the subject. Namely:
See also, this Stack Exchange thread
FischLu commentedon Mar 18, 2022
I agree with you, the sentence you quoted is ridiculous. Even if the developers stick to their views, they should be prepared for python3 in another branch. "just work" can become "just not work" in one night, now, it happens and no official "just work" solutions.
raingao commentedon Mar 18, 2022
and you should replace '/usr/bin/python' -> '/usr/local/bin/python' in /workflow/background.py
fedecalendino commentedon Mar 18, 2022
I also don't get why we didn't have a version of the code that would work on both version of Python, plenty of libraries do that.
techouse commentedon Mar 20, 2022
I faced the same issue a few weeks ago and decided to bite the bullet and migrate all my workflows to Dart because it can be compiled into a standalone executable eliminating the need for any external prerequisites.
In the process, I had to build a library just like this one in Dart. The Alfred docs helped a lot. Was a lot of work but fun 😊
devnoname120 commentedon Mar 23, 2022
See #183
5 remaining items