dennis-tra / alfred-dict.cc-workflow

🌍 Alfred 4/5 workflow to get translations from dict.cc
137 stars 4 forks source link

Does not work under 12.3 #7

Closed sven-s closed 2 years ago

sven-s commented 2 years ago

The workflow does not work under Monterey 12.3 since python 2 is no longer available.

dennis-tra commented 2 years ago

Right, thanks for reporting!

At the moment I can't prioritize migrating this workflow to python3 (that's still preinstalled on Monterey, right?). I'm still on Big Sur but as soon as I upgrade my OS I definitely need to update this workflow.

Can't promise any ETA but if anyone else comes across this issue and wants to contribute I'm more than happy to review and accept PRs 👍

Kovah commented 2 years ago

I started the workflow in debug mode and replaced /usr/bin/python with /usr/bin/python3 in the workflow script. The script starts but is throwing the following error:

ModuleNotFoundError: No module named 'cPickle'

According to this thread cPickle must be replaced with pickle.

I am not that familiar with python, but could try to upgrade to it. Not sure if any backwards compatibility is needed/wanted by you?

scrapix commented 2 years ago

I've installed python 2.7 and replaced the python path in the dict Workflow. Unfortunately it generated an ssl error.

image
scrapix commented 2 years ago

I started the workflow in debug mode and replaced /usr/bin/python with /usr/bin/python3 in the workflow script. The script starts but is throwing the following error:

ModuleNotFoundError: No module named 'cPickle'

According to this thread cPickle must be replaced with pickle.

I am not that familiar with python, but could try to upgrade to it. Not sure if any backwards compatibility is needed/wanted by you?

replacing cPickle with pickle did not solve the problem

scrapix commented 2 years ago

I assume the error might be actually on the "alfred-workflow" package which is being used within dict.cc workflow. Link to the Issue on alfred-workflow https://github.com/deanishe/alfred-workflow/issues/182

Fazod commented 2 years ago

I've installed python 2.7 and replaced the python path in the dict Workflow. Unfortunately it generated an ssl error. image

Just do "pip install certifi" (might need to do $HOME/.pyenv/versions/2.7.18/bin/pip install certifi) - that solves the issue :)

imalik8088 commented 2 years ago

Thanks @Fazod this helped resolving my issue. I've done the following changes to get back running this workflow:

# install python 2.7.x - I've installed it via pyenv
pyenv install 2.7.18
# install pkg to get ride of cert failure
~/.pyenv/versions/2.7.18/bin/pip install certifi

# update workflow like in the screenshot above ☝️ to
~/.pyenv/versions/2.7.18/bin/python dictcc_workflow.py $QUERY
# save workflow and enjoy
sven-s commented 2 years ago

pyenv install 2.7.18

does not work on Apple Silicon (Mac M1).

Fazod commented 2 years ago

pyenv install 2.7.18

does not work on Apple Silicon (Mac M1).

It does (I'm on a M1 Pro) - if you follow the KB article it just works (with the addition of the explained above installation of certifi)

Kovah commented 2 years ago

Not to be picky about that, but there's a reason why Apple removed Python 2 from Macs: it's no longer maintained and will not receive security fixes. I would not consider installing insecure software a proper solution.

svenjacobs commented 2 years ago

Not to be picky about that, but there's a reason why Apple removed Python 2 from Macs: it's no longer maintained and will not receive security fixes. I would not consider installing insecure software a proper solution.

Absolutely. A migration to Python 3 is greatly appreciated. Installing Python 2 is not a solution 😉

dennis-tra commented 2 years ago

Hi everyone,

tl;dr: I'll migrate the workflow to Go and upload a new version soon.


A little bit of context:

This workflow doesn't work anymore because it depends on https://github.com/deanishe/alfred-workflow, which in turn depends on Python 2. Python 2 is not preinstalled with recent MacOS versions anymore, and the author (deanishe) doesn't plan to support python3. However, Python 3 is also not preinstalled anymore but need the XCode Developer Tools to be installed. Hence, I'll use the go-framework awgo from him.

The problem with using Go, though, is that since MacOS Catalina binaries need to be notarized to be executable and I don't have an Apple Developer Subscription. There are ways around it, but the installation won't be as straightforward as right now.

I think it could work if someone else with an Apple Developer Subscription would just sign the binary. I'm not sure if there are any risks associated with doing that, but I don't think so.


Edit: It just came to my mind, that there probably need to be two separate workflow distributions. One for the M1 chips and another for the Intel ones.

sven-s commented 2 years ago

I can help with the Apple Developer Subscription. Just contact me, if I can help.

dennis-tra commented 2 years ago

Here we go: https://github.com/dennis-tra/alfred-dict.cc-workflow/releases

Feel free to give feedback in issue #8