Jump to content

Python2 installation seemed incorrect


Recommended Posts

@YuTang It seems installed correctly. It’s not supposed to be in /usr/bin/python. It isn’t clear why you have it in both /opt/homebrew/bin and /usr/loval/bin, though. Did you install Homebrew with Rosetta in the past?


To confirm, are you on Apple Silicon? What’s the output of ln -s /opt/homebrew/bin/python?

 

In addition to reinstalling Python 2, you also need the updated versions of those Workflows (but always check the alternatives first). In the case of the Omnifocus Workflow, you’re on an old version anyway. The developer has converted that from Python 2 to Node.js.

 

4 hours ago, Alan He said:

ln -s /usr/local/bin/python /usr/bin/python

 

That won’t work because of SIP. And that’s a good thing, because you shouldn’t be putting stuff the system doesn’t expect in /usr/bin.

Link to comment

Thanks for your kind reply! I'm really on Apple Silicon. And the output of ln -s /opt/homebrew/bin/python is ln: ./python: File exists

I remember having tried to install Homebrew before but failed and it's recently that I finally get it installed. as I have actually no knowledge of programming, I'm not sure whether this has any influence on the installation of python.

Link to comment

What are the outputs of ls -l /opt/homebrew/bin/python and ls -l /usr/local/bin/python?

 

And have you installed the newest version of the OmniFocus Workflow? As stated, that one no longer uses Python. If that one is all you’re after, there’s no need to proceed with the Python 2 installation.

Link to comment

The outputs are here:

Thank you for your kind reminder, I have already installed the new OmniFocus workflow. Yet there are still several workflows that I'm now using and that rely on python2, so I do wanna get it installed~

 

 

CleanShot_2022-08-01_14_14.08@2x.thumb.png.f5303f440060d23752c6b58566ddda40.png

Link to comment
9 minutes ago, YuTang said:

Also I like the Star Ratings workflow very much, it seems that it also relies on python 2.

 

That is on the list. You have to download it from the table.

 

49 minutes ago, YuTang said:

I would like to use a workflow named google similar images

 

The one was not on the list (it is now) because no one has requested it before. If you want it, you have to ask for it. Everything is explained on the page.

 

49 minutes ago, YuTang said:

its bundle id is here

 

Bundle IDs are not meant for searching. For future requests, please provide a download page, such as on GitHub or this forum.

 

Edited by vitor
Link to comment

So what's on earth the problem with my installation of python2, or if there is no problem, why I'm still prompted "/bin/bash: line 2: /usr/bin/python: No such file or directory" when I attempt to use workflows that rely on python2?CleanShot_2022-08-01_22_25.59@2x.thumb.png.40bad9b3a3c9fc483b468918d423696b.png

Link to comment

Thanks to the help of Vitor, I finally got a new version of it that seemed to work on my new Mac without python2. But it still doesn't work properly, and the error info is here:

 

[16:13:57.670] Logging Started...
[16:14:12.232] Google Similar Images[File Action] Processing complete
[16:14:12.235] Google Similar Images[File Action] Passing output '/Users/yutang/Documents/Global Inbox/CleanShot_2022-08-04_16.06.54@2x.png' to Run Script
[16:14:12.236] Google Similar Images[File Action] Passing output '/Users/yutang/Documents/Global Inbox/CleanShot_2022-08-04_16.06.54@2x.png' to Post Notification
[16:14:12.415] ERROR: Google Similar Images[Run Script] uploading u'/Users/yutang/Documents/Global Inbox/CleanShot_2022-08-04_16.06.54@2x.png' to Google ...
cmd=['/usr/bin/curl', '--include', '--silent', '--user-agent', 'alfred-similiar-image-search 0.1 ()', '--form', 'image_url=', '--form', 'filename=', '--form', 'h1=en', '--form', 'bih=179', '--form', 'biw=1600', '--form', 'encoded_image=@/Users/yutang/Documents/Global Inbox/CleanShot_2022-08-04_16.06.54@2x.png', 'https://www.google.com/searchbyimage/upload']
Traceback (most recent call last):
  File "url_for_image.py", line 95, in <module>
    sys.exit(main())
  File "url_for_image.py", line 88, in main
    url = similar_images_url(filepath)
  File "url_for_image.py", line 68, in similar_images_url
    output = subprocess.check_output(cmd)
  File "/Users/yutang/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/curl', '--include', '--silent', '--user-agent', 'alfred-similiar-image-search 0.1 ()', '--form', 'image_url=', '--form', 'filename=', '--form', 'h1=en', '--form', 'bih=179', '--form', 'biw=1600', '--form', 'encoded_image=@/Users/yutang/Documents/Global Inbox/CleanShot_2022-08-04_16.06.54@2x.png', 'https://www.google.com/searchbyimage/upload']' returned non-zero exit status 7
[16:14:12.424] Google Similar Images[Run Script] Processing complete
[16:14:12.425] Google Similar Images[Run Script] Passing output '' to Open URL

 

As I actually have no knowledge of programming, I can't make sense of it and have no idea what the problem is. I would highly highly appreciate it if you could please help me about this! ❤️

Link to comment

I do follow the instructions, but the situation is still the same, and I have no idea what's the problem, omg

 

[13:44:43.091] Google Similar Images[Run Script] Processing complete
[13:44:43.093] Google Similar Images[Run Script] Passing output '' to Open URL
[13:45:52.535] Google Similar Images[File Action] Processing complete
[13:45:52.544] Google Similar Images[File Action] Passing output '/Users/yutang/Documents/Global Inbox/Universal Search Workflow_Icon.png' to Run Script
[13:45:52.545] Google Similar Images[File Action] Passing output '/Users/yutang/Documents/Global Inbox/Universal Search Workflow_Icon.png' to Post Notification
[13:47:07.681] ERROR: Google Similar Images[Run Script] uploading u'/Users/yutang/Documents/Global Inbox/Universal Search Workflow_Icon.png' to Google ...
cmd=['/usr/bin/curl', '--include', '--silent', '--user-agent', 'alfred-similiar-image-search 0.1 ()', '--form', 'image_url=', '--form', 'filename=', '--form', 'h1=en', '--form', 'bih=179', '--form', 'biw=1600', '--form', 'encoded_image=@/Users/yutang/Documents/Global Inbox/Universal Search Workflow_Icon.png', 'https://www.google.com/searchbyimage/upload']
Traceback (most recent call last):
  File "url_for_image.py", line 95, in <module>
    sys.exit(main())
  File "url_for_image.py", line 88, in main
    url = similar_images_url(filepath)
  File "url_for_image.py", line 68, in similar_images_url
    output = subprocess.check_output(cmd)
  File "/Users/yutang/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/curl', '--include', '--silent', '--user-agent', 'alfred-similiar-image-search 0.1 ()', '--form', 'image_url=', '--form', 'filename=', '--form', 'h1=en', '--form', 'bih=179', '--form', 'biw=1600', '--form', 'encoded_image=@/Users/yutang/Documents/Global Inbox/Universal Search Workflow_Icon.png', 'https://www.google.com/searchbyimage/upload']' returned non-zero exit status 28

CleanShot_2022-08-05_13_48.28@2x.thumb.png.9621fc64cba4397d7cc7dcca1c508648.png

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