Hostxpeed
Login Get Started →
Troubleshooting

Fix "No module named..."

4 min read
25 views
Jun 12, 2026

Understanding the Error

ModuleNotFoundError: No module named 'requests'

Fix 1: Install Module with pip

# For Python 3
pip3 install module_name
python3 -m pip install module_name

# For Python 2 (deprecated)
pip install module_name

Fix 2: Install System Package

# Ubuntu/Debian
sudo apt install python3-requests

# CentOS/RHEL
sudo yum install python3-requests

Fix 3: Check Python Version

python --version
python3 --version

# Module installed for Python3 but running with Python2
python3 script.py  # Instead of python script.py

Fix 4: Install in Virtual Environment

# Create venv
python3 -m venv myenv
source myenv/bin/activate

# Install inside venv
pip install module_name

# Run script after activation

Fix 5: Check Module Name

# Correct vs incorrect
pip install requests        # Correct
pip install request         # Wrong

# Common name mismatches
pip install Pillow          # Import as "PIL"
pip install beautifulsoup4  # Import as "bs4"

Fix 6: Install as User (No sudo)

pip3 install --user module_name

Fix 7: Use Python Path

# Add custom module path
export PYTHONPATH="${PYTHONPATH}:/path/to/modules"

List Installed Modules

pip3 list
pip3 show module_name

Was this article helpful?