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

No longer works OOB on macOS 12.3 #27

Closed
querkmachine opened this issue Jan 31, 2022 · 76 comments
Closed

No longer works OOB on macOS 12.3 #27

querkmachine opened this issue Jan 31, 2022 · 76 comments

Comments

@querkmachine
Copy link

Emoji Taco v1.2.3 — macOS 12.3 beta.

I've just updated to the macOS 12.3 beta that dropped a couple of days ago (I live dangerously) and Emoji Taco no longer works. No errors or glitches, anything after the initial Alfred keywords (aka, involves running a python script) just doesn't work.

My assumption is that this is because macOS 12.3 removes the bundled version of Python 2 (something Apple apparently said they were going to do in 2019). Bit weird of them to do that in a minor release, but that's Apple for ya.

Just giving a head's up in case no one has pointed this out yet!

@jeeftor
Copy link
Owner

jeeftor commented Jan 31, 2022 via email

@jeeftor
Copy link
Owner

jeeftor commented Jan 31, 2022

So I'm on 12.1

image

What do you have for python --version ?

@jeeftor
Copy link
Owner

jeeftor commented Jan 31, 2022

I'm assuming 2 possible things:

  • Alfred needs an update cause Python is getting messed up
  • I need to make the code Python3 compatible (which should be pretty easy to do)

@jeeftor
Copy link
Owner

jeeftor commented Jan 31, 2022

So obviously Python3 isn't playing nice yet with the "stuff" ...

image

@querkmachine
Copy link
Author

Running python --version returns "command not found", which seems consistent with it having been removed.

I do have Python 3 installed (python3 --version returns 3.8.9), though my understanding (as per the article linked in the initial issue) is that this is only going to be true for people with Xcode installed, and it isn't enabled otherwise.

@jeeftor
Copy link
Owner

jeeftor commented Feb 1, 2022

So you are saying that out of the box the latest beta doesn't have any python? Or only has python3? I mean that's going to be a huger Alfred issue all together...

@jeeftor
Copy link
Owner

jeeftor commented Feb 1, 2022

So I'm using this library: https://github.com/deanishe/alfred-workflow which hasn't been updated to Python3.... but I'm still confused about the beta osx situation with which python is available

@LampPrinter
Copy link

Not sure if this would help. But have a look.
https://github.com/NorthIsUp/alfred-workflow-py3

@ilikepeaches
Copy link

ilikepeaches commented Feb 8, 2022

Please see https://www.alfredapp.com/help/kb/python-2-monterey/

Installing python 2 via these instructions still results in "python: command not found" errors in the debugging console for the workflow.

Changing "python" in the three script filters to "/usr/local/bin/python" (i.e. to hardcode the newly Homebrew-installed python 2.7 binary) gives this set of errors:

[00:36:12.287] ERROR: Emoji Taco[Script Filter] Code 1: .
00:36:12 workflow.py:2055 DEBUG    ---------- Emoji Taco (1.2.3) ----------
00:36:12 workflow.py:1663 DEBUG    saved data: /Users/ilikepeaches/Library/Application Support/Alfred/Workflow Data/org.jeef.emoji/download_percent.cpickle
00:36:12 workflow.py:1663 DEBUG    saved data: /Users/ilikepeaches/Library/Application Support/Alfred/Workflow Data/org.jeef.emoji/phase.cpickle
00:36:12 workflow.py:1663 DEBUG    saved data: /Users/ilikepeaches/Library/Application Support/Alfred/Workflow Data/org.jeef.emoji/emoji_count.cpickle
00:36:12 background.py:233 DEBUG    [bg] command cached: /Users/ilikepeaches/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/org.jeef.emoji/bg.argcache
00:36:12 background.py:237 DEBUG    [bg] passing job to background runner: [u'/usr/bin/python', '/Users/ilikepeaches/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DC274ADB-8DD2-4A6E-B666-01417B55E331/src/workflow/background.pyc', 'bg']
00:36:12 workflow.py:2074 ERROR    [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/ilikepeaches/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DC274ADB-8DD2-4A6E-B666-01417B55E331/src/workflow/workflow.py", line 2067, in run
    func(self)
  File "src/downloadDataFiles.py", line 83, in main
    run_in_background('bg', ['/usr/bin/python', wf.workflowfile('src/bg_downloader.py')])
  File "/Users/ilikepeaches/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.DC274ADB-8DD2-4A6E-B666-01417B55E331/src/workflow/background.py", line 238, in run_in_background
    retcode = subprocess.call(cmd)
  File "/Users/ilikepeaches/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/Users/ilikepeaches/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/Users/ilikepeaches/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

@jeeftor
Copy link
Owner

jeeftor commented Feb 8, 2022

Looks like the background download script is still calling /usr/bin/python ... I'm just a bunch of versions behind on the Mac .... hopefully the next version of Alfred will come out soon. I'll look into this but it could be the underlying lib I'm using that is providing python stuff. I tried the py3 upgrade on it and it didn't go as planned....

@ilikepeaches
Copy link

I got it mostly working by

  1. Installing python 2.7 per these instructions: https://www.alfredapp.com/help/kb/python-2-monterey/
  2. Changing "python" in the three script filters to "/usr/local/bin/python"
  3. Performing a search-and-replace of all files in the workflow bundle: search for all instances of "/usr/bin/python" and replace with "/usr/local/bin/python"

Init Emoji says that it parses 2,243 emoji, and many searches work as expected:

Screen Shot 2022-02-08 at 6 48 54 PM

but there are some obvious ones now missing?

Screen Shot 2022-02-08 at 6 46 08 PM

Hmm.

I don't see anything in the debug output that stands out.

@ilikepeaches
Copy link

Ah. I see that the no-peach issue is a separate one: #24

@vitorgalvao
Copy link

@jeeftor Go into your three script filters and make the first line:

export PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}"

That won’t make a difference to anyone using the Workflow now, and for people who are on Monterey 12.3 and followed the knowledge base article, it will work as well.

@ilikepeaches
Copy link

Unfortunately, that updated PATH won't fix the workflow by itself because several hardcoded references to /usr/bin/python remain:

Screen Shot 2022-02-09 at 11 41 37 AM

@jeeftor if you add the PATH to the script filters per @vitorgalvao and change each of those seven '/usr/bin/python' instances to just 'python' (you don't want to hardcode e.g. /usr/local/bin/python because Homebrew only installs in that location on Intel; on M1 the binary will be at /opt/homebrew/bin/python), then the script works, #24 notwithstanding.

@godbout
Copy link

godbout commented Mar 15, 2022

just installed 12.3. sacrebleu. missing my tacos emojis.

edit: this was supposed to contain the frown emoji but hey.
edit2: many stuff on my machine are broken now and i fork and update them myself to Python3 but this one is :grimace:

@jeeftor
Copy link
Owner

jeeftor commented Mar 15, 2022 via email

@vitorgalvao
Copy link

And my version keeps working and working... (so its hard to debug this
stuff)

There’s nothing to debug; it’s not a problem with your code but with the tooling it relies on. The Workflow will break for everyone on 12.3—including you—because the Python runtime is no longer present. For the Workflow to keep working you’ll have to either do the changes I and @ilikepeaches pointed out above (like so1) and instruct people to install Python2 or port the Workflow to Python3 (or another language).

Footnotes

  1. Untested, but should work. It’s a temporary host because the Workflow is massive and GitHub complains about it.

@godbout
Copy link

godbout commented Mar 15, 2022

Sorry guys -> I've been way behind working on other projects... :( And my version keeps working and working... (so its hard to debug this stuff)

no worries man. if i get a bit better at Python i'll have a look. thanks again for the tacos!

@jeeftor
Copy link
Owner

jeeftor commented Mar 16, 2022

I just ordered a new Mac today (6-8 weeks) -> so I'll likely have to fix this automation when it arrives...

So at least thats on the horizon. So I promise it will eventually get done as soon as it stops working for me

@jeeftor
Copy link
Owner

jeeftor commented Mar 17, 2022

I lied ... i'm working on the code a bit today - but no promises

@jeeftor
Copy link
Owner

jeeftor commented Mar 17, 2022

Probably wont be done today but i've got a py3 branch that i'm working on locally (outside of alfred) with only python3 so I've been porting thigs over. Decided to do a big code cleanup while I'm at it (well medium)...

And running into a few python 2-3 issues :)

@jeeftor
Copy link
Owner

jeeftor commented Mar 17, 2022

So I have the code now running with python3 BUT python3 handles unicode / emojis differently so I need to dig through that. Also making a ton of improvements that probably none of you guys care about like adding more comments and return types (totally for readability not for usefulness)

@jeeftor
Copy link
Owner

jeeftor commented Mar 18, 2022

https://github.com/jeeftor/EmojiTaco/releases/tag/py3

I haven't really had time to test this so its a crapshoot - but in theory it might kinda work

@godbout
Copy link

godbout commented Mar 18, 2022

Also making a ton of improvements that probably none of you guys care about like adding more comments and return types (totally for readability not for usefulness)

are you kidding. clean and tight code is sexy af. 😍

@jeeftor
Copy link
Owner

jeeftor commented Mar 18, 2022

I realized I forgot to update the script commands Alfred actually calls ... oops

@jeeftor
Copy link
Owner

jeeftor commented Mar 18, 2022

Need to set pythonpath I think and python3 in the scripts if you are so motivated. I'll try tomorrow

@jeeftor
Copy link
Owner

jeeftor commented Mar 18, 2022

So if somebody feels like testing stuff - I think your script commands need to look something like this:

SEARCH TASK

 PYTHONPATH=$(pwd)/src/libs python3 src/esearch.py taco

INIT TASK

# No longer needed probably
# find . -name '*.so' | xargs xattr -d -r com.apple.quarantine
 PYTHONPATH=$(pwd)/src/libs python3 src/downloadDataFiles.py 

for your execution script on the search call for example

One caveat which may / may not cause issues:

In the background downloading script I'm calling /usr/bin/python3 so I'll need some folks to verify thats legit as well.

image

@vitorgalvao
Copy link

In the background downloading script I'm calling /usr/bin/python3 so I'll need some folks to verify thats legit as well.

If you’re using an unmodified alfred-workflow Python library, it won’t work. That library only works with Python 2, not 3. See deanishe/alfred-workflow#97 for more information, and some efforts towards porting it.

@pat-s
Copy link

pat-s commented Mar 29, 2022

@jeeftor lukewaite/alfred-gitlab#27 might help. I've also successfully used it to port another workflow of mine to alfred-workflow using py3.

@jeeftor
Copy link
Owner

jeeftor commented Apr 4, 2022

Update 3

image

Looks like there were some bugs in the library update process so I'll probably pull that out for now which means ya'll have to manually update

@jeeftor
Copy link
Owner

jeeftor commented Apr 4, 2022

I'll push out another test shortly ... its going to be a bit shall we say hacky - but it might work. The main issue is you will have to run init emoji and then just wait for many minutes - or manually view some log files to see when it completes...

I dont like that but its potentially where things are at right now 😠

@jeeftor
Copy link
Owner

jeeftor commented Apr 4, 2022

ugh... looks like my release script also needs updates :(

@jeeftor
Copy link
Owner

jeeftor commented Apr 4, 2022

https://github.com/jeeftor/EmojiTaco/releases/tag/v1.2.15

Ok I pushed a new release.

Main issue is that init emoji gives you ZERO feedback and you have to just assume it will work ...

So run that wait like 5-10 mins and then try to search for emoji and give me some feedback. Won't likely try again to fix stuff until tomorrow...

@godbout
Copy link

godbout commented Apr 5, 2022

init emoji fails :frown:

[13:57:15.335] ERROR: Emoji Taco[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.CD0D6581-5808-4A7F-AE02-0A490C0AE922%3E7D136522-923D-4ACA-AAE1-14513A3840A1)] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:
b'\xaf2\x01\x00'
78511
{
  "items": [
    {
      "title": "Starting background process",
      "subtitle": "",
      "valid": false
    }
  ],
  "variables": {
    "count": 0
  },
  "rerun": 1.5
}

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

Yea I've been seeing a lot of the same errors -> what I saw on my end, however, was even after that error message it kept actually downloading the emoji in the background...

image

And once they were downloaded it started working... do you see the same behavior?

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

My suspicion is the way that strings work in Python2 vs Python3 unicode strings are different... I may take a pause on this workflow until I can port my progress bar:

image

over to Python3 in which case it might solve some of the issues. Its a MUCH simpler codebase I think

There are also other issues ... but see if you can search emoji right now...

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

image

I got the progress workflow working with Python3 - and I found

I also see the current version is "stupid" shall we say:

image

is returning:

\U0001F1E8\U0001F1E6\U0000FE0F

And now I can no longer spam my Canadian coworkers with Canada flags!! NOOO

@godbout
Copy link

godbout commented Apr 5, 2022

Yea I've been seeing a lot of the same errors -> what I saw on my end, however, was even after that error message it kept actually downloading the emoji in the background...

image

And once they were downloaded it started working... do you see the same behavior?

AH. my bad. apologies. you were right, emojis were downloaded and could be parsed. but like you i can't spam Canadians :e_sweat:

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

Getting closer:

image

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

Downloading and processing works -> its just the actual plugin that returns unicode strings and not the actual emoji that needs a patch

@godbout
Copy link

godbout commented Apr 5, 2022

i'm currently back to using EmojiTaco and it's awesome. even with the unicode string \U0001F600\U0000FE0F
i'm just asking people to go on google and check the 4th result, then they can see the emoji: https://www.google.com/search?q=%5CU0001F600%5CU0000FE0F

\U0001F44D\U0000FE0F

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

I just need some more boring meetings and I can finish this off :)

@godbout
Copy link

godbout commented Apr 5, 2022

\U0001F64F\U0000FE0F

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

image

It should just work ... !!! 😠

I know I'm just down to some super easy fix ... just can't figure out what it is yet

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

🌮️🍖️🥩️

It Works!! (Expect a new release tonight/tomorrow)

@jeeftor
Copy link
Owner

jeeftor commented Apr 5, 2022

https://github.com/jeeftor/EmojiTaco/releases/tag/v2.0.0-beta-1

Lemme know what bugs I've added!

@godbout
Copy link

godbout commented Apr 6, 2022

[13:46:17.150] ERROR: Emoji Taco[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.CD0D6581-5808-4A7F-AE02-0A490C0AE922%3E157AEB44-CD30-445B-B751-7CEDE94BC8A0)] Code 1: Traceback (most recent call last):
  File "src/esearch.py", line 8, in <module>
    from workflow import Workflow3
ModuleNotFoundError: No module named 'workflow'

e frown

@jeeftor
Copy link
Owner

jeeftor commented Apr 6, 2022 via email

@pat-s
Copy link

pat-s commented Apr 6, 2022

@jeeftor The workflow folder is missing in https://github.com/jeeftor/EmojiTaco/tree/py3/src. Maybe you just forgot to commit it? :)

@jeeftor
Copy link
Owner

jeeftor commented Apr 6, 2022

Yea I realized that. It's a symlink which I assumed would be included if I directly exported from Alfred.

I'm updating the workflow lib at the same time. I'll push an update today

@godbout
Copy link

godbout commented Apr 6, 2022

Yea I realized that. It's a symlink which I assumed would be included if I directly exported from Alfred.

I'm updating the workflow lib at the same time. I'll push an update today

hehe that's a classic one. same thing for me when i develop a workflow.

Same error on init and debug?

so i guess you know by now but yes. had tested all commands, different modules needed but same error. hadn't check the source tho (busy coding!).

@jeeftor
Copy link
Owner

jeeftor commented Apr 6, 2022

https://github.com/jeeftor/EmojiTaco/releases/tag/v2.0.1

Please let this be the one!
image

@godbout
Copy link

godbout commented Apr 6, 2022

🙈️

@godbout
Copy link

godbout commented Apr 6, 2022

aww 😍️

@godbout
Copy link

godbout commented Apr 6, 2022

ok it didn't work the first time i've launched it. ran init emoji and let it download in the foreground. once it finished it went straight to ready, no parsing etc. tried again init emoji in the background (coz it worked with v2) and i got the notifications, everything got parsed and i can paste -> 🇨🇦️.

@godbout
Copy link

godbout commented Apr 6, 2022

thank you! life is good again.

@pat-s
Copy link

pat-s commented Apr 6, 2022

Feedback on v2.0.2

init emoji seems to be stuck in a loop (quitted after 5 mins):

image

And I am still missing the preview thumbnails - but the copied emojies work and I can paste them 👍

@jeeftor
Copy link
Owner

jeeftor commented Apr 6, 2022 via email

@jeeftor jeeftor closed this as completed Apr 8, 2022
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

7 participants