---
name: "pex"
section: "1"
platform: "linux"
package: "pex"
version: "1.5.3-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pex"
---

# pex(1)

pex

## NAME

pex - pex

## SYNOPSIS

**pex** \[*-o OUTPUT.PEX*\] \[*options*\] \[*-- arg1 arg2* ...\]

## DESCRIPTION

pex builds a PEX (Python Executable) file based on the given specifications: sources, requirements, their dependencies and other options.

## OPTIONS

- **--version**

  show program's version number and exit

- **-h**, **--help**

  show this help message and exit

- **-o** PEX\_NAME, **--output-file**=*PEX\_NAME*

  The name of the generated .pex file: Omiting this will run PEX immediately and not save it to a file.

- **-p** FILE, **--preamble-file**=*FILE*

  The name of a file to be included as the preamble for the generated .pex file

- **-D** DIR, **--sources-directory**=*DIR*

  Add sources directory to be packaged into the generated .pex file.  This option can be used multiple times.

- **-R** DIR, **--resources-directory**=*DIR*

  Add resources directory to be packaged into the generated .pex file.  This option can be used multiple times.

- **-r** FILE, **--requirement**=*FILE*

  Add requirements from the given requirements file. This option can be used multiple times.

- **--constraints**=*FILE*

  Add constraints from the given constraints file.  This option can be used multiple times.

- **-v**

  Turn on logging verbosity, may be specified multiple times.

- **--pex-root**=*PEX\_ROOT*

  Specify the pex root used in this invocation of pex. \[Default: ~/.pex\]

- **--help-variables**

  Print 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

  Additional repository path (directory or URL) to look for requirements.

- **-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**

  Disable caching in the pex tool entirely.

- **--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.

- **--zip-safe**, **--not-zip-safe**

  Whether or not the sources in the pex file are zip safe.  If they are not zip safe, they will 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 of sys.path (including sitepackages) running the pex. Possible values: false (does not inherit sys.path), fallback (inherits sys.path after packaged dependencies), prefer (inherits sys.path before packaged dependencies), No value (alias for prefer, for backwards compatibility). \[Default: false\]

-

  PEX environment options:

-

  Tailor the interpreter and platform targets for the PEX environment.

- **--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 current interpreter.

- **--interpreter-constraint**=*INTERPRETER\_CONSTRAINT*

  A constraint that determines the interpreter compatibility for this pex, using the Requirementstyle format, 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") PLATFORM is the host platform e.g. "linux-x86\_64", "macosx-10.12-x86\_64", etc". IMPL is the python implementation abbreviation (e.g. "cp", "pp", "jp"). PYVER is a two-digit string representing the python version (e.g. "27", "36"). ABI is 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 to module or module:symbol.  If just specifying module, pex behaves like python **-m**, e.g. python **-m** SimpleHTTPServer.  If specifying module: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 as to the script or console\_script as defined by a 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 separate process. Warning: this could have side effects. For example, entry point \`a.b.c:m\` will translate to \`from a.b.c import m\` during validation. \[Default: False\]
