ERROR pip compatibility_error ai_generated true

ERROR: Package 'package' requires a different Python version: X.Y.Z not in '>=3.8,<3.12'

ID: pip/requires-python-mismatch

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active

Root Cause

The package declares a Python version range that does not include the current Python interpreter version. Either the package hasn't been updated for newer Python, or you need an older/newer Python version.

generic

Workarounds

  1. 90% success Install a version of the package compatible with your Python: pip install 'package<X.Y'
    pip index versions <package> to list versions, find one supporting your Python, then pip install 'package==compatible.version'
  2. 88% success Use pyenv or deadsnakes to install the required Python version
    pyenv install 3.11.0 && pyenv local 3.11.0 && pip install <package>
  3. 80% success Check if a newer version of the package supports your Python
    pip install --upgrade <package> to get the latest which may support newer Python

Dead Ends

Common approaches that don't work:

  1. Use --ignore-requires-python to force install 55% fail

    The package may use syntax or stdlib features not available in the current Python version, causing runtime errors

  2. Patch the package metadata to remove the Python version constraint 65% fail

    Does not fix actual incompatibilities in the code; may cause subtle runtime bugs

Error Chain

Leads to:
Preceded by:
Frequently confused with: