matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.52k stars 643 forks source link

No Such File or Directory Error #834

Open fatihturan opened 2 years ago

fatihturan commented 2 years ago

Hi,

Whenever I install the plugin on the xBar I get "No Such File or Directory Error" on the menu bar like this: image

I suspect on the Python installation with the Brew but Python is working without any problem and using it.

What could be source of the problem?

JacquesBackbase commented 2 years ago

if you run it in a terminal you'll see it cant find /usr/bin/python to actually execute it, this is because python2 was dropped in macos 12.3 it seems, im having same issue https://macmule.com/2022/01/29/macos-monterey-12-3-will-remove-python-2-7-usr-bin-python/

we'll need a way to point xbar to another installation of python to fix this probably, or just make it use python 3 as that would be more sustainable

fatihturan commented 2 years ago

if you run it in a terminal you'll see it cant find /usr/bin/python to actually execute it, this is because python2 was dropped in macos 12.3 it seems, im having same issue https://macmule.com/2022/01/29/macos-monterey-12-3-will-remove-python-2-7-usr-bin-python/

we'll need a way to point xbar to another installation of python to fix this probably, or just make it use python 3 as that would be more sustainable

How can we define the Python 3 as default on macOS?

JacquesBackbase commented 2 years ago

i dont think we can, didnt see a way to change it in xbar. probably not as easy as just pointing to a new version of python, might be some fundamental changes that need to be made to xbar for that

Blatman commented 2 years ago

FWIW - Using 12.2 with Python 2 still available but Python 3 installed also. Just tried the openweathermap plugin which uses Python 3 and after a couple of tweaks to the code it worked OK. The Python 3 was picked up OK at /usr/bin/python3

1st line of plugin -

!/usr/bin/env PYTHONIOENCODING=UTF-8 /usr/bin/python3

The Binance ticker plugin above worked OK because Python2 was still installed but if using 12.3 the plugin code may need updating for Python3 and /usr/bin/python3 should be OK.

JacquesBackbase commented 2 years ago

Thanks thats useful to know, im no python expert so wasnt sure if you could just do that, will see if i can fix my scripts to work on python 3 now 👍

gastonmorixe commented 2 years ago

same issue