blob: e3d1314572554a66ea698c677a944b8f7de67938 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001:mod:`distutils` --- Building and installing Python modules
2===========================================================
3
4.. module:: distutils
Georg Brandl71515ca2009-05-17 12:29:12 +00005 :synopsis: Support for building and installing Python modules into an
6 existing Python installation.
Georg Brandl116aa622007-08-15 14:28:22 +00007.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
8
9
10The :mod:`distutils` package provides support for building and installing
11additional modules into a Python installation. The new modules may be either
12100%-pure Python, or may be extension modules written in C, or may be
13collections of Python packages which include modules coded in both Python and C.
14
Larry Hastings3732ed22014-03-15 21:13:56 -070015Most Python users will *not* want to use this module directly, but instead
Nick Coghlan3894ae22014-10-26 00:00:04 +100016use the cross-version tools maintained by the Python Packaging Authority. In
17particular,
18`setuptools <https://setuptools.pypa.io/en/latest/setuptools.html>`__ is an
19enhanced alternative to :mod:`distutils` that provides:
20
21* support for declaring project dependencies
22* additional mechanisms for configuring which files to include in source
23 releases (including plugins for integration with version control systems)
24* the ability to declare project "entry points", which can be used as the
25 basis for application plugin systems
26* the ability to automatically generate Windows command line executables at
27 installation time rather than needing to prebuild them
28* consistent behaviour across all supported Python versions
29
30The recommended `pip <https://pip.pypa.io/>`__ installer runs all
31``setup.py`` scripts with ``setuptools``, even if the script itself only
32imports ``distutils``. Refer to the
Georg Brandle73778c2014-10-29 08:36:35 +010033`Python Packaging User Guide <https://packaging.python.org>`_ for more
Nick Coghlan3894ae22014-10-26 00:00:04 +100034information.
Georg Brandl116aa622007-08-15 14:28:22 +000035
Larry Hastings3732ed22014-03-15 21:13:56 -070036For the benefits of packaging tool authors and users seeking a deeper
37understanding of the details of the current packaging and distribution
38system, the legacy :mod:`distutils` based user documentation and API
39reference remain available:
Éric Araujo55729fe2011-06-02 15:45:25 +020040
Larry Hastings3732ed22014-03-15 21:13:56 -070041* :ref:`install-index`
42* :ref:`distutils-index`