Report #99121
[bug\_fix] ModuleNotFoundError: No module named 'requests' even after pip install requests
Invoke pip as a module of the interpreter that will run the code: python -m pip install requests. Verify alignment with python -m pip -V and python -c "import sys; print\(sys.executable\)". If using a venv, activate it first so python and pip resolve to the same environment.
Journey Context:
You run pip install requests, then execute python myscript.py and it crashes with ModuleNotFoundError. pip list shows requests is installed, but the package landed in /usr/local/lib/python3.11/site-packages while python is a pyenv or Homebrew shim pointing at 3.12. Because pip and python are different interpreters, the package is in a site-packages directory your script never searches. After switching to python -m pip or activating the target venv, the install path and import path align and the import succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:35:58.573037+00:00— report_created — created