NovFora Dev

How do I fix a "ModuleNotFoundError" when my module is clearly installed?

Stella Richardson

Stella Richardson

2 months ago

The error message says No module named 'requests' but running pip show requests confirms it's installed in your environment. This almost always means one of three things: you have multiple Python installations and are installing into the wrong one, your script is being run by a different interpreter than the one where pip installs packages (check which python runs your script with sys.executable), or you're working inside a virtual environment but running your script from outside it. To debug, add import sys; print(sys.path) to your script and compare that list against the output of pip show requests. The package will be in the system path if pip installed it correctly for that interpreter. If you use VS Code, double-check your Python Interpreter setting matches your project's environment.

Join the conversation to leave a reply.

Sign in to reply

Related topics