How to upload new versions of project to PyPI with twine?(如何使用 twine 将新版本的项目上传到 PyPI?)
问题描述
我已将我的 Python 包上传到 PyPI.但现在我制作了我的包的新版本,需要上传它.我试图取得与第一次上传包时相同的进展.但是给我这个错误:
I've uploaded my Python package to PyPI. But now I made new version of my package and need to upload it. I tried to make same progress which I did when upload the package first time. but give me this error:
HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy
现在,如何上传新版本没有任何错误?!
Now, how to upload new version without any error?!
推荐答案
PyPI 不允许重复使用分发文件名(项目名称+版本号+分发类型).
PyPI does not allow for the reuse of distribution filenames (project name + version number + distribution type).
这可确保给定项目的给定版本的给定发行版将始终解析为相同的文件,并且不会在某一天被项目维护者或恶意方偷偷更改(只能将其删除).
This ensures that a given distribution for a given release for a given project will always resolve to the same file, and cannot be surreptitiously changed one day by the projects maintainer or a malicious party (it can only be removed).
您需要将版本号更改为您之前未上传到 PyPI 的版本号.
You will need to change the version number to one that you haven't previously uploaded to PyPI.
您没有提及您是如何上传分发的,但如果您使用的是 twine,那么您也有可能尝试重新上传之前上传的分发.要解决此问题,您可以这样做:
You didn't mention how you're uploading the distribution, but if you're using twine, it's also possible you're attempting to re-upload a previously uploaded distribution. To resolve this, you can do:
$ twine upload --skip-existing dist/*
这篇关于如何使用 twine 将新版本的项目上传到 PyPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 twine 将新版本的项目上传到 PyPI?
基础教程推荐
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 包装空间模型 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
