简体   繁体   中英

Why does the following error pop up when twine uploading files to pypi

When I execute the following lines and put in my information

twine upload dist/*

The following error pops up

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/

After going to the url, I am not closer to solving the problem. My setup.py is the following (with blanked out information)

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

If there is any solution to this please let me know. Thank you.

Two possibilities:

  1. You forgot to rebuild the distribution or are uploading an old distribution without long_description_content_type . Make sure you're starting with an empty dist directory, rebuild your distribution and then upload.
  2. You're using an old version of some packaging dependency before long_description_content_type was supported. You need setuptools>=38.6.0 , wheel>=0.31.0 and twine>=1.11.0 . Upgrade them all with python -m pip install -U setuptools wheel twine and then do #1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM