为什么twine上传文件到pypi时会弹出以下错误

2023-12-05

当我执行以下几行并输入我的信息时

twine upload dist/*

弹出如下错误

HTTPError: 400 Client Error: The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. for url: https://upload.pypi.org/legacy/

访问该网址后,我并没有更接近解决问题。 我的 setup.py 如下(信息被删除)

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="quizmaker",
    version="0.0.1",
    author="my secret name",
    author_email="email",
    description="secret descripting",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="the url",
    packages=setuptools.find_packages(),

    python_requires='>=3.6',
)

如果有任何解决方案,请告诉我。谢谢。


两种可能性:

  1. 您忘记重建发行版或正在上传旧发行版而没有long_description_content_type。确保你从一个空的开始dist目录,重建您的发行版,然后上传。
  2. 您之前使用过某些打包依赖项的旧版本long_description_content_type得到了支持。你需要setuptools>=38.6.0, wheel>=0.31.0 and twine>=1.11.0。将它们全部升级python -m pip install -U setuptools wheel twine然后做#1。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么twine上传文件到pypi时会弹出以下错误 的相关文章