How to Know Python Package Compatibility – Python Version Compatibility Guide

pippython

I tried to install an old version of a python package and got the Could not find a version that satisfies the requirement... error. I am confident that the package and the specified version do exist, and I have learned that this problem often occurs when the package is incompatible with the python version.

How do I find out what python version I need without installing them all and trying pip install until it works?

Best Answer

You can look up the package on the Python Package Index and scroll down to the "Meta" section in the left sidebar. This shows the Python version required by the package. As you do not specify the package you are looking for, I will use numpy as an example. For the current version of numpy, the following information is listed:

Requires: Python >=3.7

Therefore, you need Python 3.7 or higher to install this version of numpy.

If you are using an older version of Python and need the most recent version of the package that is compatible with that version, you can go to the release history (the second link at the top of the sidebar) and try different versions, scrolling down to the "Meta" section for every version. This is still a manual process, but less work than trying to install every single version.

Note: often, support for older versions is dropped in larger updates (so when either the first or second version number is updated), so you can skip small updates to speed up your search process.

For example, using this process, you can deduce that numpy 1.19.5 is the latest version to support Python 3.6, and numpy 1.16.6 is the latest version to support Python 2.7. At the top of the page, the command to install an older version of a package is shown, for example: pip install numpy==1.16.6.

Related Question