xbar icon indicating copy to clipboard operation
xbar copied to clipboard

Python scripts fail on macOS 12.3 Beta

Open richardkaplan opened this issue 3 years ago • 3 comments

I upgraded to macOS 12.3 Beta and now some Python plugins do not work

For example the ProductHunt Plugin gives this error:

env:python No such file or directory

I believe this is because Python 2.7 is no longer included in macOS 12.3

I installed Python 3 and Python 2.7 manually but still get this error.

Is the script compatible with both Python 3 and Python 2.7? Or just 2.7?

In any event how do I configured the environment so it works?

richardkaplan avatar Jan 30 '22 19:01 richardkaplan

It looks like Python 3 is being used instead of Python 2, now that mac macOS 12.3 no longer includes Python. Also, the Product Hunt - Today in Tech plug-in is not compatible with Python 3 (here is a pull request to upgrade it).

dnicolson avatar Mar 16 '22 18:03 dnicolson

It seems that the issue persists with multiple plugins. Any way we can fix that for all plugins?

leocaseiro avatar Jan 04 '23 21:01 leocaseiro

Not unless you want to break your global Python installation. It's possible to install Python 2 and replace #!/usr/bin/env python with #!/usr/local/bin/python2 in individual scripts, it's not a good idea though.

Converting existing scripts to Python 3 isn't that difficult, the 2to3 tool helps with converting a script to Python 3.

I wonder how many plug-ins even still work though, the mentioned Slack plug-in shouldn't.

dnicolson avatar Jan 05 '23 08:01 dnicolson