high-yak-85899
06/14/2022, 3:53 PMexec
into a bash shell of my container, but not sure how to access the pex's interpreter that has all the third party dependencies I need.curved-television-6568
06/14/2022, 4:32 PM.pex
file, then you can invoke it with PEX_INTERPRETER=1
to get the Python REPL rather than your normal entry point:
$ PEX_INTERPRETER=1 ./cowsay.pex
Python 3.8.11 (default, Aug 28 2021, 14:08:29)
[Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import cowsay
>>>
https://pex.readthedocs.io/en/latest/api/vars.html#PEX_INTERPRETER
For containers, there’s some neat hints at how to optimize that with pex files:
https://pex.readthedocs.io/en/latest/recipes.html#pex-app-in-a-containerhigh-yak-85899
06/14/2022, 5:05 PM