PyPI 400上传错误 [英] PyPI 400 upload error

查看:313
本文介绍了PyPI 400上传错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PyPI中创建了一个名为virtdc的软件包.我进行了一些更改并上传了2个不同的版本0.1.0和0.1.1.现在,我通过PyPI Web界面删除了版本0.1.1,并尝试使用相同的版本号再次上传.它给我以下错误

...
Writing virtdc-0.1.2/setup.cfg
Creating tar archive
removing 'virtdc-0.1.2' (and everything under it)
running register
Registering virtdc to http://pypi.python.org/pypi
Server response (200): OK
running upload
Submitting dist/virtdc-0.1.2.tar.gz to http://pypi.python.org/pypi
Upload failed (400): This filename has previously been used, you should use a different version.

并且PyPI不允许一个软件包使用超过4个版本.因此,我们必须删除一些版本,然后重新上传.

即使在发生此上传错误之后,也可以使用第一个内容描述.但是下载链接不可用.您可以在此处

找到我的软件包

有人可以帮我吗?谢谢

解决方案

我遇到了同样的问题,而且似乎没有直接的解决方法:

http://sourceforge.net/p/pypi/support-requests/468

但是,如果您要上载源分发,则有一个不太丑陋的解决方法.您可以构建"zip"存档而不是"tar.gz"存档.您可以控制此通过

python setup.py sdist --formats=zip

这样,您将获得一个不同的文件名.然后,您可以直接附加上载命令

python setup.py sdist --formats=zip upload

或者您可以在构建后使用 twine 上传:

twine upload dist/*

I created a package in PyPI named virtdc. I made some changes and uploaded 2 different versions 0.1.0 and 0.1.1. Now I deleted version 0.1.1 through the PyPI web interface and try to upload again with the same version number. It is giving me error as follows

...
Writing virtdc-0.1.2/setup.cfg
Creating tar archive
removing 'virtdc-0.1.2' (and everything under it)
running register
Registering virtdc to http://pypi.python.org/pypi
Server response (200): OK
running upload
Submitting dist/virtdc-0.1.2.tar.gz to http://pypi.python.org/pypi
Upload failed (400): This filename has previously been used, you should use a different version.

And PyPI does not allow more than 4 versions for a package. So we have to delete some versions and upload again.

Even after this upload error the rst content description is available. But download link is not available. You can find my package here

Could anyone help me on this? Thanks

解决方案

I had the same problem, and it seems there is no straight fix:

http://sourceforge.net/p/pypi/support-requests/468

However, if you want to upload a source distribution, there is a workaround which is not too ugly. You can build a "zip" archive instead of a "tar.gz" archive. You can control this e.g. via

python setup.py sdist --formats=zip

This way, you obtain a different file name. Then you might append the upload command directly

python setup.py sdist --formats=zip upload

Or you might use twine to upload after building:

twine upload dist/*

这篇关于PyPI 400上传错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆