Pip install and platform specific wheels

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Pip install and platform specific wheels



How does pip install select wheels to install?


pip install



Say I've built multiple wheels for different platforms, and upload to PyPI does pip install <package> automatically install the correct wheel that matches the platform?


pip install <package>



What happens if I've built a Linux specific wheel only and upload to PyPI, and someone on Windows/Mac trying to install it by running pip install <package>?


pip install <package>




1 Answer
1



PIP follows the PEP 425 Use recommendations; this stipulates how a binary distribution wheel is selected.



Specifically, pip install will only consider compatible wheels. A wheel compatible with a different platform is not going to be downloaded.


pip install



If there are no compatible wheels, but there is a source distribution, then that source distribution is downloaded and compiled locally. If there are no compatible wheels, and no source distribution, installation fails.



Wheels can also be built for pure python projects, at which point they are no longer platform specific; these are called universal wheels. If a project uses optional binary components they can choose to produce both platform-specific wheels (including the compiled binary components specific to a Python ABI version and platform), and a universal wheel with the optional compiled components excluded. An installer can then select the universal version if no compatible binary version is available for the current platform. This is not all that common however, as a universal wheel would be preferred over a source distribution!






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

How to scale/resize CVPixelBufferRef in objective C, iOS