Python wheels are a mechanism for distributing Python packages. They can contain machine- (i.e. non Python-) code, which obviously is platform dependent but can also be specific distribution dependent. The manylinux standard is a way of minimising the dependence on the Linux distribution.

Key documents on this are available here:

Here are some of my own notes:

  1. Compilation is against an old ABI of libc and using an old C++ ABI. This provides for maximum forward compatibility

  2. Typically the wheels are built in a docker container with the an old distribution image (CentOS 5 and more lately 6), and then copied out and used outside the container. Example is referenced above.

  3. Shared library dependencies are dealt with by distributing them with the wheel itself. There is an excellent automated tool to do this, auditwheel which recursively searches for shared library dependencies and uses $ORIGIN and patchelf to rewrite the shared library dependencies so that they are easily found by the resultant Python wheel when installed.

  4. If auditwheel can not find a dependent library, add it to the LD_LIBRARY_PATH environment variable.