Report #40649
[bug\_fix] ModuleNotFoundError: No module named 'requests' \(despite running 'pip install requests' in the terminal\)
Select the correct Python interpreter in your IDE that matches the virtual environment where the package was installed \(e.g., Ctrl\+Shift\+P 'Python: Select Interpreter' in VS Code, or click the Python version in PyCharm's status bar\).
Journey Context:
You create a venv, activate it in terminal, pip install requests, then open VS Code and run your script. It crashes with ModuleNotFoundError. You check 'which python' in terminal and see the venv path, but VS Code status bar shows Python 3.9 \(system\). The terminal has the venv activated, but the IDE's Python extension is using the global interpreter which doesn't have requests. You realize the IDE runs scripts in its own selected environment, not necessarily the shell's activated venv. Changing the interpreter in the IDE updates the sys.path to include the venv's site-packages, resolving the import.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:42:05.129992+00:00— report_created — created