Configuration
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the Python Reference bibliography. |
Poetry’s own behaviour (where environments go, how the installer works, which credentials to use) is set with poetry config, in
files, or with POETRY_* environment variables. Project metadata and dependencies are not configuration: they belong in
pyproject.toml (see
pyproject.toml & Project Metadata).
This page is written against Poetry 2.5.1. The examples ran on 2026-10-22 on Linux with CPython 3.14.6, with POETRY_CONFIG_DIR,
POETRY_CACHE_DIR and POETRY_DATA_DIR pointed at empty scratch directories (shortened to …).
Where settings live
| Source | Written by | Notes |
|---|---|---|
Environment variables |
your shell or CI |
|
|
|
Project-local settings, next to |
|
|
Global (per-user) settings. |
|
|
Credentials only; see Credentials and certificates. |
When a setting is defined in several places, the precedence is, from highest to lowest: environment variables, the local
poetry.toml, the global config.toml, the default value. Credentials from auth.toml and the keyring are also overridden by
environment variables.
Default directories
| Directory | Linux | macOS | Windows | Override |
|---|---|---|---|---|
Config ( |
|
|
|
|
Data (installer-managed Poetry, |
|
|
|
|
Cache (downloads, |
|
|
|
|
poetry config
Listing and reading
poetry config --list
cache-dir = "/root/.cache/pypoetry" # …/cache
data-dir = "/root/.local/share/pypoetry" # …/data
installer.builtin-uninstall = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = false
keyring.enabled = true
python.installation-dir = "{data-dir}/python" # …/data/python
requests.max-retries = 0
solver.lazy-wheel = true
solver.min-release-age = 0
solver.min-release-age-exclude = null
solver.min-release-age-exclude-source = null
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs" # …/cache/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false
That is the complete list of 24 plain settings in Poetry 2.5.1, with their defaults (the families keyed by a name, such as
repositories.<name>.url, only appear once set). The comment after a path shows the value actually in effect: here
cache-dir reports the platform default but the POETRY_CACHE_DIR override after the #. Give a single name to read one value:
poetry config virtualenvs.path
…/cache/virtualenvs
Setting, local settings and unsetting
poetry config virtualenvs.in-project true
poetry config --local virtualenvs.create false
cat "$POETRY_CONFIG_DIR/config.toml" poetry.toml
[virtualenvs]
in-project = true
[virtualenvs]
create = false
The first block is the global config.toml, the second the project’s poetry.toml. Environment variables beat both:
POETRY_VIRTUALENVS_CREATE=true poetry config virtualenvs.create
poetry config virtualenvs.create
poetry config --local virtualenvs.create --unset
poetry config virtualenvs.create
true
false
true
--unset removes the value from the chosen file, so the next source down (here the default) applies again; the emptied
poetry.toml is left in place. Boolean environment variables accept true/1 for true; 0, false, no and an empty string all
read as false when tried. Mistakes fail with exit code 1:
poetry config virtualenvs.creat true
poetry config virtualenvs.create maybe
Setting virtualenvs.creat does not exist
"maybe" is an invalid value for virtualenvs.create
A value that starts with a dash would be read as an option; put -- before the setting name:
poetry config -- http-basic.ci ci-user -starts-with-dash. Without the -- the same command fails with
The option "s" does not exist (exit code 1).
Migrating renamed settings
poetry config --migrate (and --migrate --local for poetry.toml) rewrites settings that a newer Poetry has renamed, such as
experimental.system-git-client to system-git-client in 2.0. With nothing to change it prints:
Checking for required migrations ...
Already up to date.
Available settings
Settings marked experimental can change in later releases. Paths may use {cache-dir}, {data-dir} and, for the prompt,
{project_name} and {python_version}.
| Setting | Type | Default | Environment variable | Meaning |
|---|---|---|---|---|
|
string |
platform cache directory |
|
Where downloads, the artifact cache and (by default) virtual environments go. |
|
string |
platform data directory |
|
Where data such as Poetry-managed Pythons go. |
|
int |
number of cores + 4 |
|
Upper limit of parallel installer workers (capped at cores + 4). Since 1.2.0. |
|
string or bool |
|
|
Refuse wheels: |
|
string or bool |
|
|
Refuse sdists, same values. Explicit package names beat |
|
bool |
|
|
Install in parallel. Since 1.1.4. |
|
bool |
|
|
Uninstall with Poetry’s own routine instead of a |
|
JSON object |
none |
|
PEP 517 config settings passed to the build backend when that package has to be built. Experimental, since 2.1.0. |
|
bool |
|
|
|
|
int |
|
|
Retries on an unstable network. Since 2.0.0. |
|
string |
|
|
Where |
|
bool |
|
|
Fetch only a wheel’s METADATA with HTTP range requests. Since 1.8.0. |
|
int (days) |
|
|
Ignore releases with any file uploaded fewer than this many days ago. Since 2.4.0. |
|
string |
not set |
|
Comma-separated packages exempt from the age filter. Since 2.4.0. |
|
string |
not set |
|
Comma-separated source names or URLs exempt from the age filter. Since 2.4.0. |
|
bool |
|
|
Use the |
|
bool |
|
|
Create an environment if none exists; |
|
bool |
none |
|
|
|
bool |
|
|
Pass |
|
bool |
|
|
Create environments without pip. Since 1.2.0. |
|
bool |
|
|
Give the environment access to the system site-packages. |
|
string |
|
|
Where environments are created when not in the project. |
|
string |
|
|
Prompt shown when the environment is activated. Since 1.2.0. |
|
bool |
|
|
Create environments from the Python Poetry was installed with instead of the active |
|
string |
none |
|
URL of a repository to publish to. |
|
string |
none |
|
Username and password for a source or repository. |
|
string |
none |
|
API token for a repository ( |
|
string or bool |
none |
|
CA bundle for that repository; |
|
string |
none |
|
Client certificate for mutual TLS. |
|
bool |
|
|
Store credentials in the system keyring. |
Notes on the settings that cause most surprises:
-
installer.no-binary,installer.only-binaryandinstaller.build-config-settingsare user settings: they only decide which file is installed into a Poetry-managed environment, never what goes intopoetry.lock. Set them with--localfor one project, or as environment variables in CI. A globalinstaller.no-binary = :all:slows every project down. -
virtualenvs.in-project = truedoes not move an environment that already exists in the cache; remove it withpoetry env removefirst (see Managing Environments). -
solver.min-release-age(2.4.0) is a supply-chain guard; the filter only works for sources that publish upload times. pip’s counterpart is--uploaded-prior-to(see Supply-Chain Security). -
installer.re-resolveis why a Poetry 2.3+ install no longer resolves again from a lock file; see Lock File, Install, Update & Sync. -
Values are read and written as text:
poetry config installer.no-binary ':all:'reads back as[":all:"], andpoetry config installer.build-config-settings.grpcio '{"CC": "gcc"}'reads back the JSON unchanged.
One more knob is not a setting: the HTTP timeout is 15 seconds, like pip’s, and only the experimental environment variable
POETRY_REQUESTS_TIMEOUT (seconds) changes it.
Credentials and certificates
http-basic and pypi-token values are not stored in config.toml. They go to the system keyring when one is available, or else,
with a warning, to the plaintext auth.toml in the config directory. With the keyring disabled:
export POETRY_KEYRING_ENABLED=false
poetry config repositories.birdwatch http://127.0.0.1:8080/
poetry config http-basic.birdwatch alice "$BIRDWATCH_PASSWORD"
ls "$POETRY_CONFIG_DIR"
Using a plaintext file to store credentials
auth.toml
config.toml
auth.toml then holds a [http-basic.birdwatch] table with username and password. Give only the username and Poetry asks
for the password on the terminal (where no terminal is attached it keeps asking, so a CI job hangs: always use
POETRY_HTTP_BASIC_<NAME>_PASSWORD there). Reading a credential back is refused with
Expected a value for http-basic.birdwatch setting. Sources, repositories and certificates are covered in depth on
Repositories & Package Sources.
Compared with pip
| Concern | Poetry | pip |
|---|---|---|
Files |
|
|
Environment variables |
|
|
Command |
|
|
Credentials |
keyring or |
keyring, |
See pip: Configuration.