Jump to content

Making Python 2 Workflows work on macOS Monterey 12.3 and above


Recommended Posts

Hello Vitor,

 

To my understanding there're two steps for us to complete in order to install python 2 back to my OS Monterey system to make the workflow works as it was (current the only issue i got was the dynamic placeholder of current time&date unable to use when i upgrade to the Monterey)

 

But i got a stuck while install Homebrew on Terminal as step 1, so i can't go ahead for the step 2. Details refer my screenshots, may i know if any way out for this?

 

Appreciate your kind reply : )

Screen Shot 2022-03-30 at 12 PM 1.png

Screen Shot 2022-03-30 at 12 PM.png

Link to comment

I am getting a weird error trying to install Python 2. Due to Homebrew's readline and openssl, perhaps? Just wondering if someone could lend me a hand on figuring this out.

 


 

Quote

 

bin git:(master) pyenv install 2.7.18
zsh: correct 'install' to 'ginstall' [nyae]? n
python-build: use openssl from homebrew
python-build: use readline from homebrew
Installing Python-2.7.18...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 12.3 using python-build 2.0.4-8-gd209e061)

Inspect or clean up the working tree at /var/folders/6t/1n80sgz14bjfz32z52hxrq6m0000gn/T/python-build.20220330115345.23858
Results logged to /var/folders/6t/1n80sgz14bjfz32z52hxrq6m0000gn/T/python-build.20220330115345.23858.log

Last 10 log lines:
checking for uintptr_t... yes
checking size of uintptr_t... 8
checking size of off_t... 8
checking whether to enable large file support... no
checking size of time_t... 8
checking for pthread_t... yes
checking size of pthread_t... 8
checking for --enable-toolbox-glue... yes
configure: error: Unexpected output of 'arch' on OSX
make: *** No targets specified and no makefile found.  Stop.

 

 

Edited by Bernardo_V
Link to comment
On 3/30/2022 at 5:58 PM, giovanni said:

 

@LKolbasz I converted this to Python 3 and submitted a PR request, cc @vitor

https://github.com/giovannicoppola/alfred-percent-change

 

Why did you change the bundle id using your name in a workflow whose maintainer is not you?

 

787556302_ScreenShot2022-04-01at01_04_17.png.b2155bdfbbb9bbd7a17253c26dbb3394.png

 

Btw I didn’t know the change was related to this topic when I created this issue on the GitHub repo.

Edited by xilopaint
Link to comment

Hi @xilopaint I usually do that so that I have both versions installed and I can compare them while migrating. I left a different bundle ID as I wasn't sure about best practices, since there are others who are still using the previous version with Python 2, also whether the original author agreed with the changes etc. happy to change if that is confusing. 

Link to comment
5 hours ago, giovanni said:

Hi @xilopaint I usually do that so that I have both versions installed and I can compare them while migrating. I left a different bundle ID as I wasn't sure about best practices, since there are others who are still using the previous version with Python 2, also whether the original author agreed with the changes etc. happy to change if that is confusing. 

 

What every user expects is to have their workflow updated with the latest version and not two different versions with one of them broken.

 

Btw it’s not only a matter of confusion. You changed the bundle id of the workflow with your own name and it’s not clear to me if the real owner was aware of this change. It’s not easy to spot this kind of change on the info.plist before the pull request is approved. I can’t know the opinion of the owner, but it’s definitely not cool.

Edited by xilopaint
Link to comment
15 hours ago, Bernardo_V said:

I am getting a weird error trying to install Python 2.

 

Intel or Apple Silicon?

 

Restart your computer, then remove everything and follow the instructions to reinstall Python 2 again. Paste the Terminal output here, with the commands.

 

 

@giovanni I think @xilopaint may agree a good rule of thumb when submitting a PR is to think “is this a change the author would have done themselves?”. Ultimately a PR ends up as code in their own repo, under their name and reputation. You still get credit in the commit history and as a contributor. Some repos also have an explicit document.

 

If you make a fork and continue to develop in a different direction from the original and are not submitting your changes back, then it makes sense to change the bundle ID because they become two different tools. When you make a PR you’re contributing for there to only be one good tool most can agree on.

 

PRs are generally preferred to forks. The latter comes into play when there’s no reasonable way to proceed with the former (e.g. the original developer has abandoned the project and does not want to transfer ownership).

Link to comment

I'm trying to understand whether what exactly re-installing python 2.7 based on these instructions does. I understand that it will bring workflows relying on python2 back to life. But does it also break workflows relying on python3, i.e. can I either use python2 workflows or python3 workflows, or will both just work fine?

Link to comment
1 hour ago, Toffy said:

I'm trying to understand whether what exactly re-installing python 2.7 based on these instructions does. I understand that it will bring workflows relying on python2 back to life. But does it also break workflows relying on python3, i.e. can I either use python2 workflows or python3 workflows, or will both just work fine?

 

You're fine with both Python installations. It won't break your Python 3 workflows but some Python 2 workflows will still need a tweak to work.

Link to comment
On 3/29/2022 at 12:20 AM, vitor said:

@xilopaint I have revamped Notificator. No intensive testing yet, but it seems to work as expected. I’ll soon substitute it in all my Workflows. It’s now way more Alfred-centric, and expects to be run from inside a Workflow environment.

 

Notificator is released to the public domain, so you do not have to credit me for the inclusion. That said, because you will be adding it to a library instead of a stand-alone Workflow, I’d appreciate a note about it linking back to the original. That is so if people have suggestions or comments or complaints, they do so at the source and I can improve it for everyone.

 

Notificator integration to the library is done. It's really straightforward and alfredish. Thanks, Vítor!

Link to comment
23 hours ago, Bernardo_V said:

thanks for the suggestion, but that seems like a rather brutal approach seeing that it would delete other versions installed with pyenv.


Well, yes, because it assumes you have installed pyenv for the purpose of using Python 2. If you were already using pyenv for your own reasons, then the error should be related to your own setup and you’ll have to be the one to fix it.

Link to comment

I'd like to request for support for this https://github.com/mr-pennyworth/alfred-clipboard-ocr/releases

This worked until March 17 (think latest update to Monterey where they removed Python.) I home-brewed python  but still getting error 

STDERR: Clipboard History OCR[Run Script] mkdir: /Users/xxxxxxxx/Library/LaunchAgents: File exists
xattr: ./Tesseract.app: No such xattr: com.apple.quarantine
Load failed: 5: Input/output error

Tried the luanchctl unload and load recommended by author didn't work. 

 

 

Hope for some advise as this is really useful to search the images in clipboard!

Thanks in advance

 

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