Learn to read official documents, distutilsIntroduction (distutils - python2):
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.
In other words, the entire distutils包就是负责建立Python package is responsible for creating the installer for the Python extension module. Then the second paragraph of the document:
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:
You see, most of Python用户会使用更先进的setuptools模块,然后文档下面列了几点setuptools’s advantages are not posted here.
So why does Pycharm use Pycharm会用distutils呢?不是说setuptools? Isn’t it said that setuptools is more powerful?
The reason is simple: distutils是Python标准模块,setuptools是第三方模块。而Pycharm不知道你是否安装了setuptools is a Python standard module, and setuptools is a third-party module. And Pycharm does not know whether you have installed setuptools. To avoid unnecessary trouble, of course you must use standard modules.
Then let’s take a look at this sentence in setuptools.setup到底是个什么东西,在setuptools/__init__.py:
Learn to read official documents,
distutils
Introduction (distutils - python2):In other words, the entire
distutils
包就是负责建立Python
package is responsible for creating the installer for thePython
extension module.Then the second paragraph of the document:
You see, most of
Python
用户会使用更先进的setuptools
模块,然后文档下面列了几点setuptools
’s advantages are not posted here.So why does
Pycharm
usePycharm
会用distutils
呢?不是说setuptools
? Isn’t it said thatsetuptools
is more powerful?The reason is simple:
distutils
是Python
标准模块,setuptools
是第三方模块。而Pycharm
不知道你是否安装了setuptools
is aPython
standard module, andsetuptools
is a third-party module. AndPycharm
does not know whether you have installedsetuptools
. To avoid unnecessary trouble, of course you must use standard modules.Then let’s take a look at this sentence in
setuptools.setup
到底是个什么东西,在setuptools/__init__.py
:That’s it.