gpt4 book ai didi

python - 制作python包时在setup.py中添加 'install_requires'

转载 作者:IT老高 更新时间:2023-10-28 20:37:30 27 4
gpt4 key购买 nike

要制作一个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 是否仅适用于某些版本?

最佳答案

您需要使用 setuptools 而不是 distutils。

靠近脚本顶部,尝试替换

from distutils.core import setup

from setuptools import setup

关于python - 制作python包时在setup.py中添加 'install_requires',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9810603/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com