blob: 62abc85ac397a4ea56be2be44c39648fddb6535b [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.
Terry Jan Reedyfa089b92016-06-11 15:02:54 -04007
Georg Brandl116aa622007-08-15 14:28:22 +00008.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
9
Terry Jan Reedyfa089b92016-06-11 15:02:54 -040010--------------
Georg Brandl116aa622007-08-15 14:28:22 +000011
12The :mod:`distutils` package provides support for building and installing
13additional modules into a Python installation. The new modules may be either
14100%-pure Python, or may be extension modules written in C, or may be
15collections of Python packages which include modules coded in both Python and C.
16
Larry Hastings3732ed22014-03-15 21:13:56 -070017Most Python users will *not* want to use this module directly, but instead
Nick Coghlan3894ae22014-10-26 00:00:04 +100018use the cross-version tools maintained by the Python Packaging Authority. In
19particular,
Ned Deily8f5798e2016-06-05 17:38:48 -070020`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ is an
Nick Coghlan3894ae22014-10-26 00:00:04 +100021enhanced alternative to :mod:`distutils` that provides:
22
23* support for declaring project dependencies
24* additional mechanisms for configuring which files to include in source
25 releases (including plugins for integration with version control systems)
26* the ability to declare project "entry points", which can be used as the
27 basis for application plugin systems
28* the ability to automatically generate Windows command line executables at
29 installation time rather than needing to prebuild them
30* consistent behaviour across all supported Python versions
31
32The recommended `pip <https://pip.pypa.io/>`__ installer runs all
33``setup.py`` scripts with ``setuptools``, even if the script itself only
34imports ``distutils``. Refer to the
Georg Brandle73778c2014-10-29 08:36:35 +010035`Python Packaging User Guide <https://packaging.python.org>`_ for more
Nick Coghlan3894ae22014-10-26 00:00:04 +100036information.
Georg Brandl116aa622007-08-15 14:28:22 +000037
Larry Hastings3732ed22014-03-15 21:13:56 -070038For the benefits of packaging tool authors and users seeking a deeper
39understanding of the details of the current packaging and distribution
40system, the legacy :mod:`distutils` based user documentation and API
41reference remain available:
Éric Araujo55729fe2011-06-02 15:45:25 +020042
Larry Hastings3732ed22014-03-15 21:13:56 -070043* :ref:`install-index`
44* :ref:`distutils-index`