Where Does Poetry Keep Virtualenvs and Cache?
Where Poetry hides virtualenvs inside its cache dir on each OS, and the commands that reveal or relocate them.
Last updated
Poetry creates virtualenvs inside its cache directory by default: {cache}/virtualenvs, where the cache is ~/.cache/pypoetry on Linux, ~/Library/Caches/pypoetry on macOS and %LOCALAPPDATA%\pypoetry\Cache on Windows. Environment names mash the project name, path hash and Python version together, so the folder tells you nothing at a glance.
That hashing is why projects feel detached from their interpreters. poetry env info -p prints the active path for the current project, and poetry env remove deletes it cleanly. Reach for those two commands before browsing the cache tree by hand.
Where Poetry stores this, by platform
~/.cache/pypoetry/virtualenvs
Respects $XDG_CACHE_HOME. Override with POETRY_CACHE_DIR or poetry config cache-dir. List project envs with poetry env list --full-path.
~/Library/Caches/pypoetry/virtualenvs
Same commands as Linux. Finder hides Library, so use Go > Go to Folder. Config file lives at ~/Library/Application Support/pypoetry, separate from this cache.
%LOCALAPPDATA%\pypoetry\Cache\virtualenvs
Paste %LOCALAPPDATA%\pypoetry\Cache\virtualenvs into Explorer. Same poetry env commands apply. In-project .venv folders take precedence when present.
Frequently asked questions
Which interpreter is my editor supposed to use?
Run poetry env list --full-path in the project. It prints the exact interpreter Poetry resolves, honoring virtualenvs.path, in-project .venv folders and POETRY_VIRTUALENVS_PATH. Point your editor at that path and the mystery ends.
Can I keep the virtualenv inside my project instead?
Set virtualenvs.in-project = true (or POETRY_VIRTUALENVS_IN_PROJECT). New environments land in ./.venv inside the repo: visible, deletable, and obvious to every tool. Existing cached environments stay where they are until recreated.
Notice an outdated path? Let us know.