-
Hi All, I've created a Pex file that works when run within a running Podman container (hosted on RedHat 8) that I do my development work in, but when I try and run it on a proper VM (either RedHat 7 or 8), it fails to find the bundled python dependencies (it complains about typer in this case, that's just the first that it tries to load). ModuleNotFoundError: No module named 'typer' I ran with the verbose flag on all instances, and didn't see any glaring differences when using vimdiff, other then the addresses that libraries were being loaded into or from. I've generated the pexfile on both the RedHat 7 vm and the Podman container and the same result occurs. I'm using a script to handle the generation so that it's repeatable. How can I debug this? Has anyone else seen this? It's worth noting that in the container it's running as root (rootless podman) but outside it's running as a standard user (and that's how it'd be deployed once working). I've examined the differences in the user environments and have found nothing Python-related that exists and/or is different. Thanks for any suggestions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
PEX files don't magically work anywhere. Like anything else you need to be deliberate about enumerating the target environments you want the PEX you build to run on. Towards that end, can you provide the Pex command line used to build the PEX file and the list of target Python interpreters / systems you expect it to run on? For Linux targets the version of glibc available is critical as it plays into manylinux wheel tags. |
Beta Was this translation helpful? Give feedback.
Ok, that is a pretty naive command as it stands. You nowhere nail down the Python(s) you're building for. That is done with
--python
or--complete-platform
(--platform
is a lossy version of--complete-platform
that should probably be avoided). So, what you get now is the PEX will only guaranteed-work for the Python that hosts thepex
console script on then machine you build the PEX file on (and the associated glibc version).To see more what is going on try
unzip -qc ./bin/my-product.pex PEX-INFO | jq .
(or build your PEX file with--include-tools
or--venv
and usePEX_TOOLS=1 ./bin/my-product.pex info --indent 2
).You'll see a map of
distributions
that represent all the ~wheels your PEX …