企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
### 导航 - [索引](../genindex.xhtml "总目录") - [模块](../py-modindex.xhtml "Python 模块索引") | - [下一页](ensurepip.xhtml "ensurepip --- Bootstrapping the pip installer") | - [上一页](distribution.xhtml "软件打包和分发") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) » - zh\_CN 3.7.3 [文档](../index.xhtml) » - [Python 标准库](index.xhtml) » - [软件打包和分发](distribution.xhtml) » - $('.inline-search').show(0); | # [`distutils`](#module-distutils "distutils: Support for building and installing Python modules into an existing Python installation.") --- 构建和安装 Python 模块 - - - - - - The [`distutils`](#module-distutils "distutils: Support for building and installing Python modules into an existing Python installation.") package provides support for building and installing additional modules into a Python installation. The new modules may be either 100%-pure Python, or may be extension modules written in C, or may be collections of Python packages which include modules coded in both Python and C. Most Python users will *not* want to use this module directly, but instead use the cross-version tools maintained by the Python Packaging Authority. In particular, [setuptools](https://setuptools.readthedocs.io/en/latest/) \[https://setuptools.readthedocs.io/en/latest/\] is an enhanced alternative to [`distutils`](#module-distutils "distutils: Support for building and installing Python modules into an existing Python installation.") that provides: - support for declaring project dependencies - additional mechanisms for configuring which files to include in source releases (including plugins for integration with version control systems) - the ability to declare project "entry points", which can be used as the basis for application plugin systems - the ability to automatically generate Windows command line executables at installation time rather than needing to prebuild them - consistent behaviour across all supported Python versions The recommended [pip](https://pip.pypa.io/) \[https://pip.pypa.io/\] installer runs all `setup.py` scripts with `setuptools`, even if the script itself only imports `distutils`. Refer to the [Python Packaging User Guide](https://packaging.python.org) \[https://packaging.python.org\] for more information. For the benefits of packaging tool authors and users seeking a deeper understanding of the details of the current packaging and distribution system, the legacy [`distutils`](#module-distutils "distutils: Support for building and installing Python modules into an existing Python installation.") based user documentation and API reference remain available: - [安装Python模块(旧版)](../install/index.xhtml#install-index) - [分发 Python 模块(遗留版本)](../distutils/index.xhtml#distutils-index) ### 导航 - [索引](../genindex.xhtml "总目录") - [模块](../py-modindex.xhtml "Python 模块索引") | - [下一页](ensurepip.xhtml "ensurepip --- Bootstrapping the pip installer") | - [上一页](distribution.xhtml "软件打包和分发") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) » - zh\_CN 3.7.3 [文档](../index.xhtml) » - [Python 标准库](index.xhtml) » - [软件打包和分发](distribution.xhtml) » - $('.inline-search').show(0); | © [版权所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 软件基金会是一个非盈利组织。 [请捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [发现了问题](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 创建。