modulespackagesand distribution binary executablethat is beyond the scope of what can be covered here (look at third-party module such as py exe or py app for further detailsif all you are doing is distributing libraries or simple scripts to peopleit is usually unnecessary to package your code with the python interpreter and runtime as well finallyit should be noted that there are many more options to distutils than those covered here describes how distutils can be used to compile and +extensions although not part of the standard python distributionpython software is often distributed in the form of an egg file this format is created by the popular setuptools extension (simply change the first part of your setup py file as followssetup py tryfrom setuptools import setup except importerrorfrom distutils core import setup setup(name "spam"installing third-party libraries the definitive resource for locating third-party libraries and extensions to python is the python package index (pypi)which is located at packages that also depend on other third-party modules for the more major extensionsyou will often find platform-native installer that simply steps you through the process using series of dialog screens for other modulesyou typically unpack the downloadlook for the setup py fileand type python setup py install to install the software by defaultthird-party modules are installed in the site-packages directory of the python standard library access to this directory typically requires root or administrator access if this is not the caseyou can type python setup py install --user to have the module installed in per-user library directory this installs the package in per-user directory such as "/users/beazleylocal/lib/python /site-packageson unix if you want to install the software somewhere else entirelyuse the --prefix option to setup py for exampletyping python setup py install --prefix=/homebeazley/pypackages installs module under the directory /home/beazleypypackages when installing in nonstandard locationyou will probably have to adjust the setting of sys path in order for python to locate your newly installed modules be aware that many extensions to python involve or +code if you have downloaded source distributionyour system will have to have +compiler installed in order to run the installer on unixlinuxand os xthis is usually not an issue on windowsit has traditionally been necessary to have version of microsoft visual studio installed if you're working on that platformyou're probably better off looking for precompiled version of your extension lib fl ff