简体   繁体   English

setup.py install_requires 应该包含 setuptools 的任何原因?

[英]Any reason setup.py install_requires should include setuptools?

I've noticed some python projects include setuptools in the list of required modules.我注意到一些 python 项目在所需模块列表中包含setuptools My code installs and executes fine without it.我的代码在没有它的情况下安装并执行得很好。

I may be mistaken, but I think the purpose of the install_requires list is to specify the modules needed for execution after installation, not during installation.我可能错了,但我认为install_requires列表的目的是指定安装后执行所需的模块,而不是在安装过程中。

Is there some special use-case where it makes sense to install setuptools ?是否有一些特殊的用例可以安装setuptools

install_requires=[
    'setuptools',
    'requests',
],

If your project makes use of pkg_resources , for example to load resources from entry points , it's run-time dependent on setuptools (which includes the pkg_resources package).如果您的项目使用pkg_resources ,例如从入口点加载资源,它的运行时依赖于setuptools (其中包括pkg_resources包)。

Since Django's setup.py does not include setuptools as a requirement but does make use of pkg_resouces , this can lead to confusion .由于 Django 的setup.py不包括setuptools作为一项要求,但确实使用了pkg_resouces ,这可能会导致混淆

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM