Report #100964
[bug\_fix] ModuleNotFoundError after 'pip install foo' because pip and python point to different interpreters
Always use python -m pip install foo \(or venv/bin/python -m pip\) instead of a bare pip. This guarantees the package installs into the interpreter you are actually running.
Journey Context:
You create a venv, activate it, run pip install requests, then python -c "import requests" and get ModuleNotFoundError. You check pip list and requests is there. Then you run which pip and which python and discover pip is /usr/local/bin/pip while python is /path/to/venv/bin/python. The package was installed into the global interpreter but your shell is running the venv interpreter. Using python -m pip forces pip to run as a module inside that specific interpreter's site-packages, eliminating the ambiguity between system pip, user pip, conda pip, and venv pip.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:45:30.665942+00:00— report_created — created