为什么twine上传文件到pypi时会弹出如下错误 [英] Why does the following error pop up when twine uploading files to pypi
本文介绍了为什么twine上传文件到pypi时会弹出如下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我执行以下几行并输入我的信息时
When I execute the following lines and put in my information
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 如下(带有空白信息)
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.
推荐答案
两种可能性:
- 您忘记重新构建发行版或正在上传没有
long_description_content_type
的旧发行版.确保您从一个空的dist
目录开始,重建您的发行版,然后上传. - 在支持
long_description_content_type
之前,您正在使用旧版本的某些打包依赖项.您需要setuptools>=38.6.0
、wheel>=0.31.0
和twine>=1.11.0
.使用python -m pip install -U setuptools wheel twine
将它们全部升级,然后执行 #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 emptydist
directory, rebuild your distribution and then upload. - You're using an old version of some packaging dependency before
long_description_content_type
was supported. You needsetuptools>=38.6.0
,wheel>=0.31.0
andtwine>=1.11.0
. Upgrade them all withpython -m pip install -U setuptools wheel twine
and then do #1.
这篇关于为什么twine上传文件到pypi时会弹出如下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文