在制作python包时向setup.py添加“install_requires”

2024-06-16 14:44:20 发布

您现在位置:Python中文网/ 问答频道 /正文

要制作一个python包,在setup.py中,我有以下内容:

setup(
    name='TowelStuff',
    version='0.1.0',
    author='J. Random Hacker',
    author_email='jrh@example.com',
    packages=['towelstuff', 'towelstuff.test'],
    scripts=['bin/stowe-towels.py','bin/wash-towels.py'],
    url='http://pypi.python.org/pypi/TowelStuff/',
    license='LICENSE.txt',
    description='Useful towel-related stuff.',
    long_description=open('README.txt').read(),
    install_requires=[
    "Django >= 1.1.1",
    "caldav == 0.1.4",
],
)

所以我用我自己的包描述和信息重新制作了它。当我构建它时,虽然我得到了以下警告:

distutils/dist.py:267: UserWarning: Unknown distribution option:

install_requires是否仅对某些版本有效?


Tags: installnamepytxtpypibinversionsetup