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

Can PEX bundle a Python interpreter too? #1007

Closed
dclong opened this issue Jul 20, 2020 · 4 comments · Fixed by #2466
Closed

Can PEX bundle a Python interpreter too? #1007

dclong opened this issue Jul 20, 2020 · 4 comments · Fixed by #2466

Comments

@dclong
Copy link

dclong commented Jul 20, 2020

Is it possible for PEX to bundle a Python interpreter too so that the target machine does not even need a Python to be installed?

@jsirois
Copy link
Member

jsirois commented Jul 24, 2020

It could, but this is no easy thing. See #636 for discussion of this in the context of Google's "par" which inspired Pex. In that case, Google controlled the OS and could bundle a known python interpreter for a known target Ubuntu linux variant. Pex needs to support ~any linux variant plus OSX across many versions.

If you can suggest some way Pex could do this and retain its current "runs anywhere" (Python 2.7 or 3.5+ Linux or Mac) profile though, I agree this would be a killer feature.

@dclong
Copy link
Author

dclong commented Jul 24, 2020

@jsirois Thank you for the explanation!

@jsirois
Copy link
Member

jsirois commented Jul 15, 2024

I'm re-opening since #2096 is about to ship and I'll let the PR closing that issue close this as well for better cross-reference.

@jsirois jsirois reopened this Jul 15, 2024
jsirois added a commit to jsirois/pex that referenced this issue Jul 15, 2024
You can now specify `--scie {eager,lazy}` when building a PEX file and
one or more additional native executable PEX scies will be produced
along side the PEX file. These PEX scies will contain a portable CPython
interpreter from [Python Standalone Builds][PBS] in the `--scie eager`
case and will instead fetch a portable CPython interpreter just in time
on first boot on a given machine if needed in the `--scie lazy` case.

Although Pex will pick the target platforms and target portable CPython
interpreter version automatically, if more control is desired over which
platforms are targeted and which Python version is used, then
`--scie-platform`, `--scie-pbs-release`, and `--scie-python-version` can
be specified.

Closes pex-tool#636
Closes pex-tool#1007
Closes pex-tool#2096

[PBS]: https://github.com/indygreg/python-build-standalone
@jsirois
Copy link
Member

jsirois commented Jul 17, 2024

With the release of Pex 2.11.0, you can now add --scie {eager,lazy} to your Pex command line and get a PEX with interpreter included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants