Report #103399
[bug\_fix] VS Code runs the system Python while packages are installed in a venv, causing ModuleNotFoundError
Select the venv interpreter in the IDE \(Python: Select Interpreter in VS Code, or PyCharm project interpreter\) and restart the integrated terminal. Use 'python -m' commands in the terminal instead of relying on a global pip.
Journey Context:
You create .venv, 'pip install fastapi' inside it, then click Run in VS Code. The terminal output shows ModuleNotFoundError, even though the integrated terminal's 'pip list' shows fastapi. The status bar still shows /usr/bin/python; the IDE is launching a different interpreter than the one where packages live. Selecting .venv/bin/python in the IDE and restarting the terminal aligns the runtime, tests, and linters with the package environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:20:10.802401+00:00— report_created — created