Jump to content

Making Python 2 Workflows work on macOS Monterey 12.3 and above


Recommended Posts

It’s due to Apple’s changes. It’s also unfortunate one of the most popular programming languages in the world had a botched major version transition, but it is what it is. Human’s are fallible; the Python developers didn’t wish it to go this way either. The good news is this one is the most disruptive and one the remaining two (Perl) sees almost no use in Workflows.

Link to comment
2 hours ago, vitor said:

@zdlo Please make requests either here or on GitHub, not both places. Already answered there, and the author of the Workflow has accepted the fix.

 

Apologies, and thanks for the fix.

 

I'm a noob, and I actually use a duplicated version of the original. Could you help me apply the changes on the version I'm using, or point me in the right direction?

Link to comment
1 hour ago, dcdanny85 said:

Is it possible to get this one working?


That one is Python 3, it’s not affected by this issue. Plus, the latest release was less than a month ago so it’s under development. If you have an issue with it, the right thing to do is contact the developer on GitHub.

Link to comment
8 minutes ago, vitor said:


That one is Python 3, it’s not affected by this issue. Plus, the latest release was less than a month ago so it’s under development. If you have an issue with it, the right thing to do is contact the developer on GitHub.


I keep getting this error:
 

    import cPickle
ModuleNotFoundError: No module named 'cPickle'
15:14:33 background.py:241 ERROR    [__workflow_update_check] background runner failed with 1

 

No ideia what to do.

Link to comment

Hey there, thanks so much for this thread.

It seems that not one of the updated Alfred workflows work on my Mac. I've tried it on 3 Macs: one Intel-based, one M1 and one M1 Pro. I've downloaded the updated Python 3 versions, and not one seem to work for me. I use Alfred 4.6.5, the latest version; the same goes for MacOS (12.4).

Two of the workflows I've tried it on lie here: Convert and Power Thesaurus; the other one is Translate.

I presumed it has something to do with backups (I use them everywhere, not via clouds), maybe Alfred uses backup versions of the workflows rather than trying to use the new ones I installed instead. Right now I'm not sure that's the problem. I've tried to uninstall Alfred completely and remove all backups from my Mac, but for some reason every time on the first use Alfred says there's an error of syncing the backup from previous sync folder -- so it extracts this info of the last backup presented from somewhere. It also doesn't ask for any permissions, it already has them. However, all searches and bookmarks are "new", as well as design of the search bar. But still, I failed to install Alfred from scratch, though not sure it'd help.

Any ideas how to make this work?

Edited by Slava
Link to comment
1 hour ago, vitor said:

They’re not updated to Python 3, they’re updated to work with Python 2 after you reinstalled it. Have you done that?

Oh thanks, missed that. It's also remarkable that you manage to answer so quickly, really appreciated.

I've tried reinstalling Python 2 via Homebrew, which should be successful (no problems when following the guide), and it didn't help both my Intel-based and M1 Pro Macs. I've restarted them just to make sure and also reinstalled workflows, no luck.

I should also stress that the third workflow I've mentioned, Translate, was re-wrote on Python 3 (as developer noted) to be compatible with new MacOS update — but it doesn't work for me, either. It seems like there's some other kind of problem. Workflows that aren't dependent on Python still work OK.

UPD: I've also used the full deinstallation guide you placed here, succesfully reinstalled from scratched, but with workflows -- same result (both Python 3 and Python-2-updated).

Edited by Slava
Link to comment

What are the outputs of:

  • which python
  • /usr/local/bin/python --version
  • ls -l /usr/local/bin/python
  • /opt/homebrew/bin/python --version
  • ls -l /opt/homebrew/bin/python --version

Some of those will fail depending on if you try them on Intel or M1. No worries, but send the failure anyway.

 

51 minutes ago, Slava said:

I should also stress that the third workflow I've mentioned, Translate, was re-wrote on Python 3 (as developer noted) to be compatible with new MacOS update — but it doesn't work for me

 

That one you’ll have to ask the Workflow’s developer. This thread is for fixing what broke because of Apple; other Workflow-related matters need the eye of the developer.

Link to comment

Sorry for the inverted order, and any silly mistakes I might have encountered (like not changing the username to mine if that's required).

 

18 minutes ago, vitor said:

 

What are the outputs of:

  • which python
  • /usr/local/bin/python --version
  • ls -l /usr/local/bin/python
  • /opt/homebrew/bin/python --version
  • ls -l /opt/homebrew/bin/python --version

 

m.grivachev@macbook-m ~ % ls -l /opt/homebrew/bin/python --version

ls: --version: No such file or directory

lrwxr-xr-x  1 m.grivachev  admin  55 May 20 20:20 /opt/homebrew/bin/python -> /Users/m.grivachev/.pyenv/versions/2.7.18/bin/python2.7

 

m.grivachev@macbook-m ~ % /opt/homebrew/bin/python --version

Python 2.7.18

m.grivachev@macbook-m ~ %

 

m.grivachev@macbook-m ~ % ls -l /usr/local/bin/python

ls: /usr/local/bin/python: No such file or directory
m.grivachev@macbook-m ~ % /usr/local/bin/python --version

zsh: no such file or directory: /usr/local/bin/python

 

m.grivachev@macbook-m ~ % which python

python not found

m.grivachev@macbook-m ~ %
Link to comment
17 minutes ago, vitor said:

Are you certain you downloaded and installed the versions from the table? Also, why not use the listed alternatives? That’s the recommended option. For Convert there’s CalculateAnything (you may need to brew install php)


Yes, I'm certain I've downloaded the correct ones. I've re-checked and re-installed multiple times.

Now it seems that any Python workflows just don't work for me anymore. As I mentioned above, Python-3-updated Translate won't work for me. I've just downloaded the updated Power Thesaurus version you so kindly attached, and no luck as well.

Seems really frustrating, as the issue affects all my computers.

Php, which I've also tried when looked for alternatives, won't install for reasons unknown:

 

m.grivachev@macbook-m ~ % brew install php

zsh: command not found: brew

 

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