Python packaging: wheels vs tarball (tar.gz) Python packaging: wheels vs tarball (tar.gz) python python

Python packaging: wheels vs tarball (tar.gz)


This answered it for me (directly from the wheel PEP):

Python needs a package format that is easier to install than sdist. Python's sdist packages are defined by and require the distutils and setuptools build systems, running arbitrary code to build-and-install, and re-compile, code just so it can be installed into a new virtualenv. This system of conflating build-install is slow, hard to maintain, and hinders innovation in both build systems and installers.

Wheel attempts to remedy these problems by providing a simpler interface between the build system and the installer. The wheel binary package format frees installers from having to know about the build system, saves time by amortizing compile time over many installations, and removes the need to install a build system in the target environment.

https://www.python.org/dev/peps/pep-0427/#rationale

Note the tarballs we're speaking of are what are referred to as "sdists" above.


From Python Wheels

Advantages of wheels

• Faster installation for pure python and native C extension packages.
• Avoids arbitrary code execution for installation. (Avoids setup.py)
• Installation of a C extension does not require a compiler on Windows or OS X.
• Allows better caching for testing and continuous integration.
• Creates .pyc files as part of installation to ensure they match the python interpreter used.
• More consistent installs across platforms and machines.

Make sure wheel is installed.

python3 -m pip install wheel