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?!
Go to PyPI and create an account. Run twine upload dist/* in the terminal/command line. Enter the account credentials you registered for on the actual PyPI. Then, run pip install [package_name] to install your package.
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).
You will need to change the version number to one that you haven't previously uploaded to PyPI.
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/*
Can get that error for following reasons:
setup.py
Solution:
setup.py
. python setup.py bdist_wheel
.twine upload --skip-existing dist/*
As mentioned by @dustin, dist file of same name cannot be uploaded again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With