← All Articles

ModuleNotFoundError: No Module Named — Python Fix Guide

What Does This Error Mean?

Python's import system cannot find the module you're trying to import. Either it's not installed, not in your Python path, or you have a typo.

Common Causes

  • Package not installed in the current environment
  • Virtual environment not activated
  • Typo in the module name
  • Wrong Python version (system vs venv)

How to Fix It

1. Install the package

pip install requests

2. Activate your virtual environment

source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

3. Check which Python you're using

which python
python -c "import sys; print(sys.path)"