blob: 31c4ae5b23906b0bd12ab644e424bd91e84ae26b [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
Steve Dower62949f62021-01-29 21:48:55 +000012:mod:`distutils` is deprecated with removal planned for Python 3.12.
13See the :ref:`What's New <distutils-deprecated>` entry for more information.
14
15--------------
16
Georg Brandl116aa622007-08-15 14:28:22 +000017The :mod:`distutils` package provides support for building and installing
18additional modules into a Python installation. The new modules may be either
19100%-pure Python, or may be extension modules written in C, or may be
20collections of Python packages which include modules coded in both Python and C.
21
Larry Hastings3732ed22014-03-15 21:13:56 -070022Most Python users will *not* want to use this module directly, but instead
Nick Coghlan3894ae22014-10-26 00:00:04 +100023use the cross-version tools maintained by the Python Packaging Authority. In
24particular,
Ned Deily8f5798e2016-06-05 17:38:48 -070025`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ is an
Nick Coghlan3894ae22014-10-26 00:00:04 +100026enhanced alternative to :mod:`distutils` that provides:
27
28* support for declaring project dependencies
29* additional mechanisms for configuring which files to include in source
30 releases (including plugins for integration with version control systems)
31* the ability to declare project "entry points", which can be used as the
32 basis for application plugin systems
33* the ability to automatically generate Windows command line executables at
34 installation time rather than needing to prebuild them
35* consistent behaviour across all supported Python versions
36
37The recommended `pip <https://pip.pypa.io/>`__ installer runs all
38``setup.py`` scripts with ``setuptools``, even if the script itself only
39imports ``distutils``. Refer to the
Georg Brandle73778c2014-10-29 08:36:35 +010040`Python Packaging User Guide <https://packaging.python.org>`_ for more
Nick Coghlan3894ae22014-10-26 00:00:04 +100041information.
Georg Brandl116aa622007-08-15 14:28:22 +000042
Larry Hastings3732ed22014-03-15 21:13:56 -070043For the benefits of packaging tool authors and users seeking a deeper
44understanding of the details of the current packaging and distribution
45system, the legacy :mod:`distutils` based user documentation and API
46reference remain available:
Éric Araujo55729fe2011-06-02 15:45:25 +020047
Larry Hastings3732ed22014-03-15 21:13:56 -070048* :ref:`install-index`
49* :ref:`distutils-index`