pypi UserWarning:未知分发选项:“ install_requires” [英] pypi UserWarning: Unknown distribution option: 'install_requires'
问题描述
执行PyPI软件包的 python setup.py install
时,是否会遇到此警告?
Does anybody encounter this warning when executing python setup.py install
of a PyPI package?
install_requires
定义软件包的要求。许多PyPI软件包都有此选项。
install_requires
defines what the package requires. A lot of PyPI packages have this option. How can it be an "unknown distribution option"?
推荐答案
python setup.py
使用不支持install_requires的distutils。 setuptools这样做,还分发(它的后继),而pip(使用其中一个)做。但是实际上您必须使用它们。即通过 easy_install
命令或 pip install
调用setuptools。
python setup.py
uses distutils which doesn't support install_requires. setuptools does, also distribute (its successor), and pip (which uses either) do. But you actually have to use them. I.e. call setuptools through the easy_install
command or pip install
.
另一种方法是从setup.py中的setuptools导入安装程序,但这不是标准方法,这使得每个想要使用您的软件包的人都必须安装setuptools。
Another way is to import setup from setuptools in your setup.py, but this not standard and makes everybody wanting to use your package have to have setuptools installed.
这篇关于pypi UserWarning:未知分发选项:“ install_requires”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!