🔧 Error Fixes
· 2 min read
Last updated on

pip: No Matching Distribution Found — How to Fix It


ERROR: No matching distribution found for package-name

What causes this

pip searched PyPI (or your configured index) and couldn’t find a package that matches your request. This doesn’t always mean the package doesn’t exist — it often means there’s no version compatible with your Python version, operating system, or architecture.

Common causes:

  • The package name is wrong or misspelled
  • The package doesn’t support your Python version (e.g., Python 3.12 but the package only has wheels for 3.9-3.11)
  • The package doesn’t have a wheel for your OS/architecture (common on ARM Macs and Alpine Linux)
  • You’re using an old version of pip that can’t find newer packages
  • You’re behind a firewall that blocks PyPI

Fix 1: Check the package name

Package names on PyPI are case-insensitive but must be exact:

# ❌ Common mistakes
pip install opencv        # Wrong — it's opencv-python
pip install sklearn       # Wrong — it's scikit-learn
pip install beautifulsoup # Wrong — it's beautifulsoup4
pip install yaml          # Wrong — it's pyyaml

# ✅ Correct names
pip install opencv-python
pip install scikit-learn
pip install beautifulsoup4
pip install pyyaml

Search PyPI directly: https://pypi.org/search/

Fix 2: Check your Python version

Some packages don’t support all Python versions:

python --version

If you’re on a very new Python (e.g., 3.13) and the package hasn’t released compatible wheels yet, you have two options:

# Option A: Use an older Python version
pyenv install 3.11.8
pyenv local 3.11.8
pip install package-name

# Option B: Install from source (if the package supports it)
pip install --no-binary :all: package-name

Fix 3: Upgrade pip

Old pip versions can’t parse newer package metadata:

pip install --upgrade pip
pip install package-name

This fixes a surprising number of “no matching distribution” errors.

Fix 4: Check your platform

Some packages don’t have pre-built wheels for every platform. This is common on:

  • Apple Silicon Macs (arm64)
  • Alpine Linux (musl instead of glibc)
  • 32-bit systems
# Check your platform
python -c "import platform; print(platform.machine(), platform.system())"

If there’s no wheel for your platform, try installing build dependencies and compiling from source:

# Install build tools first
pip install wheel setuptools
pip install --no-binary :all: package-name

Fix 5: Network or firewall issues

If you’re behind a corporate firewall:

# Use a specific index URL
pip install --index-url https://pypi.org/simple/ package-name

# Or use a trusted host flag
pip install --trusted-host pypi.org --trusted-host pypi.python.org package-name

How to prevent it

  • Always check the exact package name on pypi.org before installing
  • Keep pip updated: pip install --upgrade pip
  • Use pyenv to manage Python versions so you can switch if a package doesn’t support your version
  • Pin your dependencies in requirements.txt with exact versions so you know they work
  • Use virtual environments to isolate project dependencies
📘