【问题标题】:Why does the following error pop up when twine uploading files to pypitwine上传文件到pypi时为什么会弹出如下错误
【发布时间】:2020-06-30 03:06:59
【问题描述】:

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

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',
)

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

【问题讨论】:

    标签: python module upload pypi twine


    【解决方案1】:

    两种可能:

    1. 您忘记重建分发版或上传没有long_description_content_type 的旧分发版。确保您从一个空的 dist 目录开始,重建您的发行版,然后上传。
    2. 在支持 long_description_content_type 之前,您使用的是某些打包依赖项的旧版本。您需要setuptools>=38.6.0wheel>=0.31.0twine>=1.11.0。使用 python -m pip install -U setuptools wheel twine 升级它们,然后执行 #1。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-15
      • 2017-12-11
      • 2020-09-22
      • 2018-03-18
      • 2017-03-18
      • 2012-11-07
      • 2021-03-29
      • 1970-01-01
      相关资源
      最近更新 更多