Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MacOS 12.3? #24

Open
andrehofmeyr opened this issue Mar 21, 2022 · 16 comments
Open

Support for MacOS 12.3? #24

andrehofmeyr opened this issue Mar 21, 2022 · 16 comments

Comments

@andrehofmeyr
Copy link

Many thanks for this awesome workflow, I use it all the time.

Since updating to MacOS 12.3 it doesn't work though, because Apple no longer supports Python 2.7 :(

Is there an easy way to update the workflow to work with Python 3?

Cheers,
Andre

@rodnem
Copy link

rodnem commented Mar 31, 2022

Hello I think I've got the same trouble…
Impossible to make it work
I got PHP 8.1.4 installed via homebrew and the workflow is set to /usr/local/bin/php
But it still doesn't work

I also use it all the time… thanks for your help

--- edit
I also install python via homebrew but it doesn't work neither

@pnome
Copy link

pnome commented Apr 12, 2022

Same here. I really miss using this - it was so useful!

@jplomas
Copy link

jplomas commented Apr 13, 2022

Python 2.7 via Homebrew alone will not work.

The steps here will keep this working: https://www.alfredapp.com/help/kb/python-2-monterey/

export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
eval "$(brew shellenv)"
brew install pyenv
pyenv install 2.7.18
ln -s "${HOME}/.pyenv/versions/2.7.18/bin/python2.7" "${HOMEBREW_PREFIX}/bin/python"

Tested today on fully updated Monterey 12.3 (SIP enabled).

@wookayin
Copy link

This project is no longer maintained, still relying on python2.7. The above workaround of installing python2.7 is a good idea. Or consider switching to other similar workflow, such as https://github.com/deanishe/alfred-unicode/.

@bevesce
Copy link
Owner

bevesce commented Apr 14, 2022

This project is no longer maintained, still relying on python2.7.
It's just a bit neglected, not not-maintained. I don't think that making authoritative statements like this out of nowhere is cool.

I'll look into this but my Mac can't be updated to Monterey, so I haven't had the issue myself.

@bevesce
Copy link
Owner

bevesce commented Apr 14, 2022

I updated the script to work in python 3 too, but I don't have a way to actually test it on Monterey, so if any of you could check it out and let me know it would be great

@wookayin
Copy link

@bevesce That's great to hear! Thanks a lot for the update. The workflow works well out-of-box on Monterey 12.3 for me. In my environment I do not have python2.

image

Although there is a subtle issue on escaping characters due to the bytes-vs-unicode difference, I think the workflow will work well if it's working on your development environment.

@andrehofmeyr
Copy link
Author

Many thanks @bevesce!

Unfortunately, it doesn't appear to be working for me:
image

This is exactly the error I've been getting since updating to 12.3, given that Python 2 no longer exists.

@jplomas
Copy link

jplomas commented Apr 14, 2022

Worked for me too once I'd unlinked Python2:

rm "${HOMEBREW_PREFIX}/bin/python"
ln -s ~/.pyenv/versions/3.9.4/bin/python "${HOMEBREW_PREFIX}/bin/python"

Thanks for updating @bevesce !

@andrehofmeyr -- this may work:

export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"
eval "$(brew shellenv)"
brew install pyenv
pyenv install 3.9.4
ln -s "${HOME}/.pyenv/versions/3.9.4/bin/python3" "${HOMEBREW_PREFIX}/bin/python"

@andrehofmeyr
Copy link
Author

@jplomas thanks for the suggestion, but I'm running the latest version of Python (3.10), and don't want 3.9.4 lying around. Strange that it works with 3.9.4 and not 3.10 🤷🏽‍♂️

@NeighNeighNeigh
Copy link

NeighNeighNeigh commented Apr 15, 2022

Sadly I'm getting the same error trying to run the new workflow.

Unable to run task!

Reason: launch path not accessible

/usr/bin/python

Check that the selected language exists on your system.

If you're syncing Alfred's preferences, also check that all related workflow files exist locally.

Related Workflow Info...
Name: 'Unicode Symbols Search'
Folder:/Users/nathan/Dropbox/Maintenance/Systems/Alfred/Alfred.alfredpreferences/workflows/user.workflow.7C031774-C834-498A-BD76-FF9E1DE5BE79

@0laus
Copy link

0laus commented Apr 26, 2022

Great workflow. Unfortunately I'm running in to the same issues as mentioned above.

@Sheraff
Copy link

Sheraff commented Jul 10, 2022

For me, in order to make the workflow work I did the following:

  • install python 3, <3.10 (different install methods give different install locations)
  • copy the script inside alfred's interface into a file main_script.py at the root of the alfred workflow folder
  • add a shebang as the first line of the script, pointing to my python binary
    #!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
    
  • give execution permissions with chmod +x main_script.py
  • in alfred, change Language to "External Script" and point to main_script.py in the text input below

@sleepymalc
Copy link

@Sheraff 's solution is probably the most simple and stable one. I somehow make it works months before, and after updating to Monterey 12.5 yesterday, it doesn't work again. Turns out that making it into an external script is quite simple.

@NeighNeighNeigh
Copy link

Seems recent Alfred allows for changing the script language to Python 3. Simply adjusting this within the Alfred workflow makes it work again. Yay!

Screen Shot 2022-08-31 at 20 34 56

@DJF3
Copy link

DJF3 commented May 30, 2023

I got it working with MacOS Ventura (13.4) and Alfred 3:

  • Install flow
  • Change "USS" script filter to (in my case) /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 symbolssearch.py "{query}"

Change the symbolssearch.py code:

  • line 3: from html import escape (was "from cgi import escape")
  • line 38: return ('<items>' + items + '</items>') (removed .encode)
  • line 57: query = ' '.join((s for s in sys.argv[1:])) (removed .decode part)
  • line 61: symbols = f.read().splitlines() (removed .decode)
  • line 71: print(r) (added brackets)

And now it works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests