Report #104219
[bug\_fix] ModuleNotFoundError: No module named 'requests'
Activate the virtual environment and install the package: \`source venv/bin/activate\` then \`pip install requests\`. If the package is already installed in the system Python but not in the venv, ensure the venv is activated and that the package is listed in requirements.txt or installed explicitly.
Journey Context:
A developer was working on a Flask web app inside a virtual environment. After cloning the repo, they ran \`python app.py\` and got \`ModuleNotFoundError: No module named 'requests'\`. They checked \`pip list\` and saw requests wasn't installed in the venv, but it was present globally. The root cause: they had not activated the virtual environment, so the system Python was used, which had requests installed, but the venv's Python \(which is isolated\) did not. The fix was to activate the venv \(\`source venv/bin/activate\`\) and then install dependencies from requirements.txt. The error is common when developers forget to activate the venv or when the venv was created but not populated with dependencies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-19T20:03:57.751208+00:00— report_created — created