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

Support for multiple versions of Python in same pex file #341

Closed
itamarst opened this issue Jan 11, 2017 · 1 comment
Closed

Support for multiple versions of Python in same pex file #341

itamarst opened this issue Jan 11, 2017 · 1 comment

Comments

@itamarst
Copy link
Contributor

Use case: we want to distribute command-line tools written in Python to Linux users, and tell users "it'll work as long as you have Python 3.4, 3.5 or 3.6".

First prerequisite is manlinux1 wheels. Once that is supported we still have a problem, though: any package that has C extensions will result in pex file only working on version of Python it was built for. E.g. if pex was built with 3.4 and run with 3.5:

$ PEX_VERBOSE=1 python3.5 dist/reloopd --help
pex: Found site-library: /usr/lib/python3.5/dist-packages
pex: Found site-library: /usr/lib/python3/dist-packages
pex: Found site-library: /usr/local/lib/python3.5/dist-packages
pex: Tainted path element: /usr/local/lib/python3.5/dist-packages
pex: Tainted path element: /usr/lib/python3/dist-packages
pex: Scrubbing from user site: /home/itamarst/.local/lib/python3.5/site-packages
pex: Scrubbing from site-packages: /usr/local/lib/python3.5/dist-packages
pex: Scrubbing from site-packages: /usr/lib/python3/dist-packages
pex: Failed to resolve a requirement: The 'Twisted==16.6.0' distribution was not found and is required by the application
pex: Failed to resolve a requirement: The 'PyYAML==3.12' distribution was not found and is required by the application
pex: Failed to resolve a requirement: The 'zope.interface==4.3.3' distribution was not found and is required by the application
pex: Unresolved requirements:
pex:   - zope.interface
pex:   - twisted
pex:   - pyyaml
pex: Distributions contained within this pex:
pex:   - Twisted-16.6.0-cp34-cp34m-linux_x86_64.whl
pex:   - PyYAML-3.12-cp34-cp34m-linux_x86_64.whl
pex:   - reloop-0+untagged.14.g07067a9.dirty-py3-none-any.whl
pex:   - click-6.7-py2.py3-none-any.whl
pex:   - constantly-15.1.0-py2.py3-none-any.whl
pex:   - setuptools-32.3.1-py2.py3-none-any.whl
pex:   - zope.interface-4.3.3-cp34-cp34m-linux_x86_64.whl
pex:   - incremental-16.10.1-py2.py3-none-any.whl
Failed to execute PEX file, missing compatible dependencies for:
zope.interface
twisted
pyyaml

The only solution AFAICT is to support including wheels for multiple versions of Python (3.4, 3.5, 3.6).

@kwlzn
Copy link
Contributor

kwlzn commented Apr 10, 2017

thanks for the details. fwiw, it is possible today to generate multi-interpreter pex files today via pants (github.com/pantsbuild/pants) - but is indeed something we'd like to pull directly into pex soonish.

marking closed as a duplicate of #68 - feel free to follow along on that one for updates.

@kwlzn kwlzn closed this as completed Apr 10, 2017
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

No branches or pull requests

2 participants