• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1:mod:`distutils` --- Building and installing Python modules
2===========================================================
3
4.. module:: distutils
5   :synopsis: Support for building and installing Python modules into an
6              existing Python installation.
7
8.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
9
10--------------
11
12: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
17The :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
22Most Python users will *not* want to use this module directly, but instead
23use the cross-version tools maintained by the Python Packaging Authority. In
24particular,
25`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ is an
26enhanced 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
40`Python Packaging User Guide <https://packaging.python.org>`_ for more
41information.
42
43For 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:
47
48* :ref:`install-index`
49* :ref:`distutils-index`
50