Closed jensbodal closed 2 years ago
Thanks @jensbodal! I'm suffering from this problem now (and I'm the author...). Would you mind giving some more details about how exactly you did this part:
I was able to get around this be installing platypus and rebuilding the app wrapper with the python path set to
/usr/local/bin/python
I've tried using Platypus with the path set to a valid Python interpreter, like this:
but I seem to still encounter the same error:
By the way, I don't believe it has to be a Python2 interpreter -- the open-in-editor
python script works under Python2 and Python3, which I just confirmed by running it directly from the command line:
/usr/local/bin/python3 ./open-in-editor ./open-in-editor:7
Would you be able to push your working app bundle to a fork of this repo or attach it as a file in this comment thread? I seem to be failing at using Platypus to create an app bundle that doesn't try to access /usr/bin/python
.
In my case the problem was that old versions of the OpenInEditor app were registered with the OS. In case it helps anyone else what I did was use
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump
to view the registry, and then delete the OpenInEditor
entries on disk.
I'n #11 I've changed the MacOS app so that it looks for python at /usr/local/bin/python
which should fix this since Apple's SIP doesn't prevent us from putting files and symlinks at that location.
By the way, when I drag&drop the script in platypus, it's identified as of type env
with /usr/bin/env
, and I don't need to add any extra symlinks, the #!/usr/bin/env python
hashbang works fine
On your screenshot I see that you manually set the link to python
Apple decided to remove python2 in latest MacOS. So there is no longer a
/usr/bin/python
binary and it’s quite convoluted to re-populate it with a symlink due to SIP.I was able to get around this be installing platypus and rebuilding the app wrapper with the python path set to
/usr/local/bin/python
and then symlinking python2 there.