Skip to content
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

Update init so that sys.executable points to python #4

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

jonatanklosko
Copy link
Member

When running hf/transformers, during the first time a model is downloaded, I noticed a long message with BEAM executable usage. It turns out that there is a Python module that may spawn another Python OS process when certain shared resources are opened, such as shared memory, semaphores, to make sure the resources are never leaked (ref). The issue is that it tries to spawn sys.executable (effectively argv[0]), which points to the BEAM executable. This PR fixes it, such that it points to a Python executable.

This introduces a breaking change to Pythonx.init, and I decided to remove it from the API altogether, until there is an actual use case for it. In practice, I don't see a good reason no to use Pythonx.uv_init, especially that getting the paths correctly across OSes can be tricky.

@jonatanklosko jonatanklosko merged commit f9dfafe into main Feb 21, 2025
9 checks passed
@jonatanklosko jonatanklosko deleted the jk-init branch February 21, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant