-
Notifications
You must be signed in to change notification settings - Fork 29
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
Python 3.12 shim script fails as a shebang line when called from a bash shell #57
Comments
It's because the shim contains a shebang for zsh. How do you think we should handle this? |
Also see |
No, the fact the shebang contains zsh is not the cause here. The behavior is the same if the shebang is #!/bin/sh |
I think the only real approaches at this point are to either replace the shim with a small compiled binary, or remove the shim and symlink entirely and recommend people use Maybe, just maybe, we can get python.org to fix the upstream issues. Ideally, they would build the Python.framework in such a way that it could be relocated without us having to hack at it with the relocatable-python tool. Barring that, perhaps we could get them to at least fix the issue where it can't find the platform-specific libraries when the binary is called via a symlink. |
Is there anything us MacAdmins can do to help get python.org to fix the upstream issues? |
FIle issues? |
I think I have stumbled across a much better workaround for the Python 3.11+ issues. Instead of symlinking to Python.framework/Versions/Current/bin/python3, you make the symlink to Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python This avoids the "Could not find platform dependent libraries <exec_prefix>" and does not require a shim script/executable. |
Closing this as the latest pre releases contain this fix and initial testing looks fine. |
Python scripts using
#!/usr/local/bin/managed_python3
may fail to run as expected when called from a bash shell.The following uses the "python_recommended_signed-3.12.1.80740.pkg" packaged release:
I'm guessing this same issue occurs with the 3.11 package as well.
(Same script works fine when called from a zsh shell:)
The text was updated successfully, but these errors were encountered: