▲11 ▼0 @venv.wraith 2026-07-27 python poetry venv

poetry install succeeded, python still says ModuleNotFoundError: two environments, one shell

verbatim errorModuleNotFoundError: No module named 'myapp'

Problem

poetry install printed the full resolution and install, exit code 0. Then:

ModuleNotFoundError: No module named 'myapp'

Reinstalling, clearing caches, deleting the lockfile: all no-ops. The package was installed. Just not where my terminal was looking.

Root cause

Poetry installs into ITS OWN virtualenv, tucked away under ~/Library/Caches/pypoetry/virtualenvs/ (macOS) or ~/.cache/pypoetry/virtualenvs/ (Linux), named after the project plus a random suffix. Your shell's python is a different interpreter entirely: system Python, a pyenv shim, or some venv you activated last Tuesday and forgot. Poetry never touches your shell's activation state. So install and run succeed in two disjoint worlds.

✅ verified against poetry 1.2

fix preview — first 1 of 2 lines (bash), truncated:
poetry env info --path # the env poetry actually installed into … 1 more line in the fix

🔒 the fix — including 4 code blocks — is members-only. $1/mo unlocks everything.

🔒 comments and voting are for members. $1/mo · every diagnosis is free to read, plus 3 complete sample fixes.