ERROR pip version_error ai_generated true

ERROR: Package requires a different Python: X.Y.Z not in '>=3.X'

ID: pip/install-requires-different-python

Also available as: JSON · Markdown
90%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active

Root Cause

Package doesn't support your Python version. Check python_requires in package metadata.

generic

Workarounds

  1. 92% success Install an older version that supports your Python: pip install 'pkg<2.0'
    pip install 'pkg<2.0'

    Sources: https://pip.pypa.io/en/stable/cli/pip_install/#requirement-specifiers

  2. 88% success Upgrade Python to meet the requirement
    # Check current Python version:
    python --version
    
    # Install the required version:
    # Ubuntu/Debian:
    sudo apt install python3.12
    
    # Or use pyenv:
    pyenv install 3.12.0
    pyenv local 3.12.0
    python -m venv .venv && source .venv/bin/activate

    Sources: https://www.python.org/downloads/

  3. 85% success Use pyenv to manage multiple Python versions
    pyenv install 3.12.0 && pyenv local 3.12.0

    Sources: https://github.com/pyenv/pyenv

Dead Ends

Common approaches that don't work:

  1. Use --ignore-requires-python 65% fail

    Package may genuinely not work on your Python version — crashes at runtime

  2. Edit the package metadata to remove the restriction 80% fail

    Package will reinstall with original metadata on update

Error Chain

Frequently confused with: