PEX(1)
π NAME π
hii bestie, this is the manual page for pex β yeah, the name is literally just pex, no notes, it's giving minimalist icon behavior. It lives in the User Commands corner of your man pages, section 1. π
πΈ SYNOPSIS πΈ
pex [-o OUTPUT.PEX] [options] [-- arg1 arg2 ...]
π¦ DESCRIPTION π¦
okay so here's the vibe: pex builds a PEX (a Python Executable) file, and it does that based on the specifications you hand it β your sources, your requirements, all their dependencies, and whatever other options you feel like throwing in there. β¨
It's basically β¨manifestingβ¨ a self-contained executable out of your specs. Obsessed, honestly. π
π OPTIONS π
no cap, here's every single one. buckle up, bestie, there's a lot and we're doing ALL of them. π«Ά
--versionβ shows the program's version number and then exits. bye! π-h,--helpβ shows this help message and exits. the classic.-o PEX_NAME,--output-file=PEX_NAMEβ the name of the generated.pexfile. real talk though: if you omit this, PEX just runs immediately and doesn't save itself to a file at all. so it's either "make me a file" or "just go, girl". π-p FILE,--preamble-file=FILEβ the name of a file that gets included as the preamble for the generated.pexfile.-D DIR,--sources-directory=DIRβ add a sources directory to be packaged into the generated.pexfile. you can use this option multiple times. π-R DIR,--resources-directory=DIRβ add a resources directory to be packaged into the generated.pexfile. also usable multiple times. π-r FILE,--requirement=FILEβ add requirements from the given requirements file. yep, multiple times is allowed here too.--constraints=FILEβ add constraints from the given constraints file. also multiple times, she's flexible. β¨-vβ turns on logging verbosity. can be specified multiple times, so go off, stack those v's. π₯--pex-root=PEX_ROOTβ specify the pex root used in this invocation ofpex. [Default:~/.pex]--help-variablesβ prints out help about the various environment variables used to change the behavior of a running PEX file.
Resolver options:
Tailor how to find, resolve and translate the packages that get put into the PEX environment.
--pypi,--no-pypi,--no-indexβ whether to use pypi to resolve dependencies. Default: use pypi.--pex-path=PEX_PATHβ a colon separated list of other pex files to merge into the runtime environment.-f PATH/URL,--find-links=PATH/URL,--repo=PATH/URLβ an additional repository path (directory or URL) to look for requirements in.-i URL,--index=URL,--index-url=URLβ additional cheeseshop indices to use to satisfy requirements. π§--pre,--no-preβ whether to include pre-release and development versions of requirements. Default: only stable versions are used, unless explicitly requested.--disable-cacheβ disables caching in the pex tool entirely. she's raw-dogging it. π--cache-dir=CACHE_DIRβ the local cache directory to use for speeding up requirement lookups. [Default:~/.pex/build]--cache-ttl=CACHE_TTLβ the cache TTL to use for inexact requirement specifications.--wheel,--no-wheel,--no-use-wheelβ whether to allow wheel distributions. Default: allow wheels. π--build,--no-buildβ whether to allow building of distributions from source. Default: allow builds.--manylinux,--no-manylinux,--no-use-manylinuxβ whether to allow resolution of manylinux dists for linux target platforms. Default: allow manylinux.
π«Ά PEX output options π«Ά
Tailor the behavior of the emitted .pex file if -o is specified. (iykyk β no -o, no file, no vibes.)
--zip-safe,--not-zip-safeβ whether or not the sources in the pex file are zip safe. if they are not zip safe, they'll be written to disk prior to execution. Default: zip safe.--always-write-cacheβ always write the internally cached distributions to disk prior to invoking the pex source code. this can use less memory in RAM constrained environments. [Default: False]--ignore-errorsβ ignore run-time requirement resolution errors when invoking the pex. [Default: False]--inherit-path=INHERIT_PATHβ inherit the contents ofsys.path(including sitepackages) when running the pex. possible values are:false(does not inheritsys.path),fallback(inheritssys.pathafter packaged dependencies),prefer(inheritssys.pathbefore packaged dependencies), and no value at all (which is an alias forprefer, kept around for backwards compatibility). [Default:false]
π PEX environment options π
Tailor the interpreter and platform targets for the PEX environment. this is the main character section, fr fr.
--python=PYTHONβ the Python interpreter to use to build the pex. either specify an explicit path to an interpreter, or specify a binary accessible on$PATH. this option can be passed multiple times to create a multi-interpreter compatible pex. Default: use the current interpreter.--interpreter-constraint=INTERPRETER_CONSTRAINTβ a constraint that determines the interpreter compatibility for this pex, using theRequirementstyleformat, e.g."CPython>=3", or">=2.7"for requirements agnostic to interpreter class. this option can be passed multiple times.--rcfile=RC_FILEβ an additional path to a pexrc file to read during configuration parsing. used primarily for testing.--python-shebang=PYTHON_SHEBANGβ the exact shebang (#!...) line to add at the top of the PEX file, minus the#!. this overrides the default behavior, which picks an environment python interpreter compatible with the one used to build the PEX file. π--platform=PLATFORMSβ the platform for which to build the PEX. this option can be passed multiple times to create a multiplatform pex. to use wheels for specific interpreter/platform tags, you can append them to the platform with hyphens like:PLATFORM-IMPL-PYVER-ABI(e.g."linux_x86_64-cp-27-cp27mu","macosx_10.12_x86_64-cp-36-cp36m").PLATFORMis the host platform, e.g."linux-x86_64","macosx-10.12-x86_64", etc".IMPLis the python implementation abbreviation (e.g."cp","pp","jp").PYVERis a two-digit string representing the python version (e.g."27","36").ABIis the ABI tag (e.g."cp36m","cp27mu","abi3","none"). Default: current platform.--interpreter-cache-dir=INTERPRETER_CACHE_DIRβ the interpreter cache to use for keeping track of interpreter dependencies for the pex tool. Default:~/.pex/interpreters.
π PEX entry point options π
Specify what target/module the PEX should invoke, if any.
-m MODULE[:SYMBOL],-e MODULE[:SYMBOL],--entry-point=MODULE[:SYMBOL]β set the entry point tomoduleormodule:symbol. if you just specifymodule, pex behaves likepython -m, e.g.python -m SimpleHTTPServer. if you specifymodule:symbol, pex imports that symbol and invokes it as if it were main.-c SCRIPT_NAME,--script=SCRIPT_NAME,--console-script=SCRIPT_NAMEβ set the entry point to the script or console_script as defined by any of the distributions in the pex. for example:"pex -c fab fabric"or"pex -c mturk boto". π--validate-entry-pointβ validate the entry point by importing it in a separate process.
β οΈ Warning: this could have side effects. for example, entry pointa.b.c:mwill translate tofrom a.b.c import mduring validation. [Default: False]
and that's the whole page, bestie!! you made it, I'm so proud of you. π₯Ήπ this absolute banger of a manual is pex 1.5.3-1, dated June 2022. go forth and build your little executables. slay, periodt, no cap. πβ¨π¦
π¦ where this page comes from
- debian bookworm: pex 1.5.3-1 Β· Apache-2.0
- debian trixie: pex 1.5.3-1 Β· Apache-2.0
- ubuntu noble: pex 1.5.3-1 Β· Apache-2.0
- ubuntu questing: pex 1.5.3-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms