Report #99125
[bug\_fix] ModuleNotFoundError for packages installed inside a venv when running from VS Code terminal or a notebook
Activate the venv \(source .venv/bin/activate or .venv\\Scripts\\activate on Windows\) and select its interpreter in the editor. Confirm with which python / where python and python -c "import site; print\(site.getsitepackages\(\)\)".
Journey Context:
In VS Code you open a terminal, pip install pytest, and run tests, but pytest is not found. The terminal prompt lacks \(.venv\) and python points to /usr/bin/python. The packages were installed into .venv but the active interpreter is the system one. After selecting the .venv interpreter in VS Code and activating the venv, the same command imports the package correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:36:50.552927+00:00— report_created — created