The distutils 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 is an enhanced alternative to distutils that provides:
The distutils 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 is an enhanced alternative to distutils that provides:🎜
学会看官方文档,
distutils
的介绍(distutils - python2):distutils
的介绍(distutils - python2):也就是说,整个
distutils
包就是负责建立Python
扩展模块的安装器用的。然后是文档的第二段:
看见了吧,大部分
Python
用户会使用更先进的setuptools
模块,然后文档下面列了几点setuptools
的优点,这里就不贴出来了。那么为什么
Pycharm
会用distutils
呢?不是说setuptools
更强大么?原因很简单:
distutils
是Python
标准模块,setuptools
是第三方模块。而Pycharm
不知道你是否安装了setuptools
,为避免不必要的麻烦,当然要用标准模块了。然后我们看一下
也就是说,整个setuptools.setup
到底是个什么东西,在setuptools/__init__.py
distutils
包就是负责建立Python
扩展模块的安装器用的。然后是文档的第二段:🎜 🎜看见了吧,大部分
Python
用户会使用更先进的setuptools
模块,然后文档下面列了几点setuptools
的优点,这里就不贴出来了。🎜 🎜那么为什么Pycharm
会用distutils
呢?不是说setuptools
更强大么?🎜 🎜原因很简单:distutils
是Python
标准模块,setuptools
是第三方模块。而Pycharm
不知道你是否安装了setuptools
,为避免不必要的麻烦,当然要用标准模块了。🎜 🎜然后我们看一下setuptools.setup
到底是个什么东西,在setuptools/__init__.py
中有这么一句:🎜 🎜就是这样。🎜