为什么将麻线上传文件到pypi时弹出以下错误

问题描述 投票:0回答:1

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

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/

进入url之后,我距离解决问题还很近。以下是我的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个回答
0
投票

两种可能性:

  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。
© www.soinside.com 2019 - 2024. All rights reserved.