Pip: No useful warning if Python version is too low for desired package

Created on 1 Sep 2020  Â·  5Comments  Â·  Source: pypa/pip

Environment

(I am reporting this problem, because a user of my software encountered it. Therefore I do not have all the specifics.)

  • pip version: 20 or lower
  • Python version: 3.6.9
  • OS: Linux Mint 19.2 Tina

Description

When trying to install a package, which offers no version compatible with the current Python version, the following error message is raised:

ERROR: Could not find a version that satisfies the requirement [package-name] (from versions: none)
ERROR: No matching distribution found for [package-name]

While technically correct, this does not inform the user what the actual problem is (their version of Python is too low).

Expected behavior

Tell the user that the package could be installed for a higher version of Python.

How to Reproduce

Try to install any package that requires a Python version higher than the one on the system, e.g., install a package requiring Python 3.8 on a system with Python 3.6.

UX UX- error messages

All 5 comments

I believe this is already tracked somewhere, but couldn’t find the issue at the moment, and will keep this open for the moment. Can you describe what message would you expect to see in this situation?

Can you describe what message would you expect to see in this situation?

Something like:

ERROR: Could not find a version that satisfies the requirement … for your version of Python. The requirement … can be fulfilled for Python 4.2 or higher. Consider upgrading Python.

Until we find out which issue also reported this, I just want to drop by and say this applies to all platform incompatibilities, including Python version too high (e.g. tensorflow six==1.10.0 on Python 3.8), ABI and architecture (in case the project only provides binary).

Likely #7797 (or its cousin #6526)

I think #6526 is the broader issue that this one is tied to (like how all our dependency resolution ones are tied to 988).

Was this page helpful?
0 / 5 - 0 ratings