How does pip decide which many linux wheel to use?

You need pip 8.1 or later and a linux distribution that is based on glibc (and not musl libc as alpine linux for instance).

EDIT: the function pip._internal.utils.compatibility_tags.get_supported() should return the list of supported platform tags in order. Pip prefers wheel tags that appear earlier in this list over tags that appear later.

Also may I kindly suggest you to use python 3.5 instead of 2.7 ;)


Since pip version 19.3, TargetPython.get_tags() returns the supported PEP 425 tags to check wheel candidates against (source). The tags are returned in order of preference (most preferred first).

from pip._internal.models.target_python import TargetPython
target_python = TargetPython()
pep425tags = target_python.get_tags()

The class TargetPython encapsulates the properties of a Python interpreter one is targeting for a package install, download, etc.


For pip 10 you'll need to run:

from pprint import pprint
import pip._internal
pprint(pip._internal.pep425tags.get_supported())

So, the correct answer is that pip has a list of supported tags and will try to match those. pip.pep425tags.get_supported() will list the tags for your platform and will also use that list to match manylinux binary wheels.