Options used to locate Python interpreters used by all Pants backends.

This subsystem controls where and how Pants will locate Python, but beyond that it does not control which Python interpreter versions are actually used for your code: see the python subsystem for that.

Backend: pants.core
Config section: [python-bootstrap]

Basic options


Advanced options


--python-bootstrap-search-path="[<binary-paths>, <binary-paths>, ...]"



A list of paths to search for Python interpreters.

Which interpeters are actually used from these paths is context-specific: the Python backend selects interpreters using options on the python subsystem, in particular, the [python].interpreter_constraints option.

You can specify absolute paths to interpreter binaries and/or to directories containing interpreter binaries. The order of entries does not matter.

The following special strings are supported:

For all runtime environment types:

  • <PATH>, the contents of the PATH env var

When the environment is a local_environment target:

  • <ASDF>, all Python versions currently configured by ASDF (asdf shell, ${HOME}/.tool-versions), with a fallback to all installed versions
  • <ASDF_LOCAL>, the ASDF interpreter with the version in BUILD_ROOT/.tool-versions
  • <PYENV>, all Python versions under $(pyenv root)/versions
  • <PYENV_LOCAL>, the Pyenv interpreter with the version in BUILD_ROOT/.python-version
  • <PEXRC>, paths in the PEX_PYTHON_PATH variable in /etc/pexrc or ~/.pexrc

Can be overriden by field python_bootstrap_search_path on local_environment, docker_environment, or remote_environment targets.


--python-bootstrap-names="[<python-binary-names>, <python-binary-names>, ...]"



The names of Python binaries to search for. See the --search-path option to influence where interpreters are searched for.

This does not impact which Python interpreter is used to run your code, only what is used to run internal tools.

Can be overriden by field python_bootstrap_names on local_environment, docker_environment, or remote_environment targets.

Deprecated options