Report #99633
[bug\_fix] ModuleNotFoundError after pip install reports 'already satisfied'
Always invoke pip via the interpreter that will run the code: 'python -m pip install ...'. Verify with 'python -c "import sys; print\(sys.executable\)"' and 'python -m pip -V'. If they point to different installations, recreate or reactivate the correct virtual environment and reinstall. Root cause: 'pip', 'pip3', and 'python' may resolve to different interpreters or venvs depending on PATH, shell aliases, and whether the venv is activated.
Journey Context:
You activate a venv, run 'pip install requests', it succeeds, then 'python app.py' crashes with ModuleNotFoundError. 'pip list' shows requests installed. The trap is that the 'pip' executable resolved to /usr/bin/pip while 'python' resolved to /venv/bin/python, so the package was installed into a different site-packages directory than the one your script uses. Using 'python -m pip' guarantees the pip module is loaded by the same interpreter that runs your code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:47:54.137220+00:00— report_created — created