Description
This is a common pattern that I'm seeing in pip's issue tracker; so filing an issue to (a) trigger a discussion of how to improve documentation / output / errors to better deal with the mismatch in user expectations vs behaviour here and (b) consolidate those issues.
Basically, the fundamental problem here is that pip has various options that affect the wheels that pip will consider when triaging things (--platform <platform>
, --python-version <python_version>
, --implementation <implementation>
, --abi <abi>
) but those do not affect the marker evaluation environment for dependencies.
This results in a subtle failure mode: pip install [options] package
will use a wheel for package that has a (hypothetical) Python version 9.22 but when evaluating environment markers (https://packaging.python.org/en/latest/specifications/dependency-specifiers/#environment-markers), that would still use the environment for the current Python interpreter.
It is not possible to compute the environment markers based on the values passed in by the user via the CLI.