Report #103394
[bug\_fix] ModuleNotFoundError: No module named 'requests' even though 'pip list' shows requests installed
Use the same interpreter for both pip and the runtime. Either activate the venv first, or always invoke the venv's Python explicitly: 'python -m pip install requests' and 'python script.py'. Do not rely on a bare 'pip' when multiple Python installations exist.
Journey Context:
You create a venv, run 'pip install requests', then run 'python script.py' and get ModuleNotFoundError. 'pip list' still shows requests. You reinstall, upgrade pip, and check PATH for twenty minutes. Eventually 'which python' reveals /usr/bin/python while 'which pip' points to /usr/local/bin/pip; the package was installed into a different interpreter's site-packages. Activating the venv, or consistently using 'python -m pip' with the venv's python, forces pip and the runtime to share sys.executable and site-packages.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:19:17.762382+00:00— report_created — created