Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyPI 400 upload error

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

like image 538
Dany Avatar asked Feb 24 '15 23:02

Dany


2 Answers

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/*
like image 117
Maik Avatar answered Oct 13 '22 00:10

Maik


This worked for me:

  1. Delete the build, dist, and <package name>.egg-info folders in your root directory.
  2. Change version number in your setup.py file.
  3. Create distribution again. e.g: python setup.py sdist bdist_wheel
  4. Upload distribution again. e.g: twine upload dist/*
  5. enjoy! :-)
like image 25
RichArt Avatar answered Oct 13 '22 00:10

RichArt