Packaging and distributing your Python code can be a complex and sometimes confusing task, especially if your projects have lots of dependencies or involve components more exotic than straight Python code. However, for many cases it's very straightforward to make your code accessible to others in a standard way, and we'll see how to do that using the standard distutils module in this section. The main advantage of distutils is that it’s included in the Python Standard Library. For much beyond the simplest packaging requirements you'll probably want to look at setup tools instead, which has capabilities beyond those of distutils, but which is correspondingly more confusing.
The distutils module allows you to write a simple Python script which knows how to install your Python modules into any Python installation, including one hosted...