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 I build PEX with system wide site-packages? #3

Closed
wants to merge 3 commits into from

Conversation

kamilchm
Copy link

@kamilchm kamilchm commented Aug 1, 2014

I build an app for Linux that uses Python gobject bindings provided by my system (Debian in my case). It's in /usr/lib/python2.7/dist-packages.
When I start pex with --inherit-path it prints:

Scrubbing from site-packages: /usr/lib/python2.7/dist-packages

When I try to import gobject i get:

>>> import gobject
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named gobject

I want to distribute my app as a deb and resolve system wide dependencies when installing it by dpkg.
Is there any way I can use system provided lib in my PEX?

@kamilchm
Copy link
Author

Digging deeper I found:

pex: PYTHONPATH contains:
pex:     /tmp/tmpDrkLUE/.bootstrap
pex:     /tmp/tmpDrkLUE
pex:     /usr/lib/python2.7
pex:     /usr/lib/python2.7/plat-x86_64-linux-gnu
pex:     /usr/lib/python2.7/lib-tk
pex:   * /usr/lib/python2.7/lib-old
pex:     /usr/lib/python2.7/lib-dynload
pex:     /usr/lib/python2.7/dist-packages/PILcompat
pex:     /usr/lib/python2.7/dist-packages/gst-0.10
pex:     /usr/lib/python2.7/dist-packages/gtk-2.0
pex:     /usr/lib/pymodules/python2.7
pex:   * - paths that do not exist or will be imported via zipimport

I can import gtk that lives in /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.pyc but I can't do it with gobject from /usr/lib/python2.7/dist-packages/gobject/__init__.pyc.

@jsirois
Copy link
Member

jsirois commented Sep 9, 2019

Thanks for attempting a fix. Please accept our apologies for the epically long delay in responding! This has since been fixed a few times, the latest in #449.

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.

2 participants