LinuxWindowsmacOS

Where Does Poetry Store Envs and Cache?

Where Poetry keeps virtualenvs, cache, config, and auth on each desktop OS.

Last updated

Poetry splits state three ways: virtualenvs plus artifact cache under the cache dir, and config.toml with auth.toml under the config dir. POETRY_HOME (the install) is a fourth, separate tree.

Defaults are ~/.cache/pypoetry and ~/.config/pypoetry on Linux and macOS, with LocalAppData and AppDataRoaming twins on Windows. In-project venvs (.venv) opt out of the central cache per project when enabled.

Where Poetry stores this, by platform

Linux
~/.cache/pypoetry/virtualenvs/

virtualenvs/ plus artifacts cache. Config in ~/.config/pypoetry/. In-project .venv folders bypass the cache when enabled per project.

Windows
%LOCALAPPDATA%\pypoetry\Cache\virtualenvs\

Same envs plus cache layout under LocalAppData. Auth and sources in RoamingAppData poetry/. Long env paths can exceed legacy limits; keep POETRY_HOME short.

macOS
~/.cache/pypoetry/virtualenvs/

Same split as Linux. Homebrew and official installer layouts agree on these roots; check poetry env info -p for the live env.

Frequently asked questions

How do I rebuild a Poetry env?

Delete the env folder under virtualenvs/ for the project, then run poetry install again. Keep config.toml and auth.toml; they hold sources and credentials. Pycache-style wipes never fix resolver issues, env rebuilds do.

Envs versus config: what lives where?

Virtualenvs default under the cache dir (virtualenvs/ beside artifacts/) unless in-project venvs are enabled. Config and PyPI tokens live in the config dir. Move both trees plus the project to migrate fully.

Notice an outdated path? Let us know.