Jump to content

Making Python 2 Workflows work on macOS Monterey 12.3 and above


Recommended Posts

Just now, Travis Schmeisser said:

Output is "ls: /usr/local/bin/python: No such file or directory"

 

That means something wasn’t correctly followed or went wrong when following the instructions. Specifically the last command:

 

ln -s "${HOME}/.pyenv/versions/2.7.18/bin/python2.7" "${HOMEBREW_PREFIX}/bin/python"

 

Link to comment
1 hour ago, vitor said:

 

The error means that particular action requires the Objective-C bridge. There’s a very small subset of Python 2 Workflows who do. At the moment it’s not viable to support those because the required Python packages fail (for me?) to build under Apple Silicon. If you’re on Intel, you may be able to do so ("${HOME}/.pyenv/versions/2.7.18/bin/python2.7" -m pip install PACKAGE_NAME) but the build failure makes it impossible for me to support it.

 

 

 

As it were, I am using a Mac intel.

I managed to get it working by specifically uninstalling AppKit and force re-installing pyobjc

 

Thanks for the hint @vitor

Link to comment
On 3/23/2022 at 11:05 AM, vitor said:

No, that just uninstalls the package itself, it does not remove the changes made by it.

 

OK, thanks. I've entered those commands. As I say, that just removes the pyenv version of python 2. Any ideas on how to remove the intel package python 2 once my workflows are updated to python 3?

Link to comment

@deanishe The fuzzy script does not seem to be working after upgrading to 12.3. This is a really important script since it powers multiple workflows for me. Anything I can do to make it work? I tried changing /usr/bin/python to /usr/bin/python3 but that didn't help. Other errors came up which I could not fix:

 

error:

raceback (most recent call last):
  File "./fuzzy.py", line 377, in <module>
    main()
  File "./fuzzy.py", line 364, in main
    fb = cache.load()
  File "./fuzzy.py", line 312, in load
    json.dump(fb, fp)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 180, in dump
    fp.write(chunk)
TypeError: a bytes-like object is required, not 'str'

 

 

Edited by andy4222
Link to comment
8 hours ago, Larrikin said:

Any ideas on how to remove the intel package python 2

 

You installed from a PKG, and those can do essentially anything. For instructions on how to uninstall that, you’ll have to check their website. Or you can try a specialised tool.

 

@andy4222 Please read and follow the top post. This is not a thread to ask every developer about their Workflow, use the Workflow’s own thread for that. If you need a fuzzy finder alternative, @Mr Pennyworth has one.

 

5 hours ago, andy4222 said:

 

Added.

Link to comment
22 hours ago, vitor said:

 

The error means that particular action requires the Objective-C bridge. There’s a very small subset of Python 2 Workflows who do. At the moment it’s not viable to support those because the required Python packages fail (for me?) to build under Apple Silicon. If you’re on Intel, you may be able to do so ("${HOME}/.pyenv/versions/2.7.18/bin/python2.7" -m pip install PACKAGE_NAME) but the build failure makes it impossible for me to support it.

 

 

Welcome @eshmootie,

 

That Workflow doesn’t use Python, so whatever is broken is something else. @Acidham has a Workflow you may wish to try.

 

 

Try again with:
 

eval "$(brew shellenv)"
ls -la "${HOMEBREW_PREFIX}/bin/python"

 

 

 

Thank you,

 

However, when i run 'airpd' in alfred i get the following error log:

Is this something due to Python or should i take it in the workflow thread?

 

1696798514_Skrmavbild2022-03-24kl_14_00_50.thumb.png.8b3278109475e08729793567b1761064.png

Link to comment
Just now, eshmootie said:

Is this something due to Python

 

That is indeed Python-related, but the Workflow doesn’t have Python code that I can see. Are you sure you’re on the latest version?

 

2 minutes ago, eshmootie said:

or should i take it in the workflow thread?

 

Yes.

Link to comment
On 3/23/2022 at 11:53 AM, vitor said:

 

That means something wasn’t correctly followed or went wrong when following the instructions. Specifically the last command:

 

ln -s "${HOME}/.pyenv/versions/2.7.18/bin/python2.7" "${HOMEBREW_PREFIX}/bin/python"

 

 

@vitor I went through again line by line in Terminal and Browser Choice is working now. I swear I tried that multiple times before, but maybe I mis-copied/pasted something. So sorry for wasting your time! I really appreciate the help.

Link to comment

I am using ESV Bible Online, which previously was able to select a verse, and paste it into the front most app. It no longer works, but instead searches for the scripture online. I ran the workflow in Debugging Mode, and received the following error messages:

 

[12:59:55.990] Logging Started...

[13:00:21.426] ESV Online Bible[Script Filter] Queuing argument '(null)'

[13:00:21.453] ESV Online Bible[Script Filter] Script with argv '(null)' finished

[13:00:21.457] ERROR: ESV Online Bible[Script Filter] Code 127: /bin/bash: line 1: python: command not found

 

Any ideas on how to make this work?

Link to comment

Thank you for adding the dict.cc workflow. It finds python now, but SSL fails:

 

Dict.cc[Script Filter] <?xml version="1.0" encoding="utf-8"?>

<items><item valid="no"><title>Error in workflow 'Dict.cc'</title><subtitle>[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>

 

Is this due to old Python not having the newest certs anymore or something else?

Link to comment
6 hours ago, andy4222 said:

Was there a change made to this to make it work with 12.3? It still does not work

 

Again, you need to read and follow the top post. That error means you either did not download the updated version, or you did not (correctly?) reinstall Python 2. The top post explains all of this.

 

4 hours ago, Mollib said:

Thank you for adding the dict.cc workflow. It finds python now, but SSL fails

 

Welcome @Mollib. That error is unrelated to the port, so you’ll have to ask the developer. Or consider a non-Python alternative.

 

2 hours ago, cands said:

Would it be possible to add alfred-cheat?

 

Added. But please let the developer know about the Python deprecation. If they don’t know, they can’t fix it. Informing the developer should always be the first step.

Edited by vitor
Link to comment
On 3/23/2022 at 8:36 PM, eshmootie said:

Not sure if this is because of the update to 12.3 but as of the update the following workflow is broken for me:

 

Possible to add it to the list?

 

 

~~not related to Python. bluetooth output changed again in 12.3. i guess they're playing around and trying to find a way to make bluetooth work properly on their laptop. anyways, relevant post/repo have been updated. enjoy.~~

 

EDIT: my bad, i thought it was about the Alfred AirPods Pro Battery, which broke under 12.3. Alfred AirPods Pro Connector might break too, but it never worked reliably lately (never?). can have a look.

 

EDIT2: ok workflow updated. please see the relevant thread.

Edited by godbout
Link to comment
52 minutes ago, vitor said:

 

Again, you need to read and follow the top post. That error means you either did not download the updated version, or you did not (correctly?) reinstall Python 2. The top post explains all of this.

 

 

Welcome @Mollib. That error is unrelated to the port, so you’ll have to ask the developer. Or consider a non-Python alternative.

 

 

Added. But please let the developer know about the Python deprecation. If they don’t know, they can’t fix it. Informing the developer should always be the first step.

Thank you very much! alfred-cheat is working again on macOS 12.3, very nice. (Agree that informing the developer should be the first step, I noted on the workflow repository that the developer is aware and therefore did not post here on Alfred forum.)

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