Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I re-upload package to pypi?

Tags:

python

pypi

I upload a package to pypi, but I got some trouble after upload, so I delete it completely, and I tried to re-upload, but there are some error after upload again: HTTP Error 400: This filename has previously been used, you should use a different version. error: HTTP Error 400: This filename has previously been used, you should use a different version. It seems pypi can track the upload activity, I delete project and account and upload again, but I can see the previous record. Why? How can I solve the problem?

like image 528
zeleven Avatar asked Jun 13 '17 09:06

zeleven


People also ask

Can a package be removed from PyPI?

Go to your packages. Check the "remove" checkbox for the particular package. Click "Remove" button.

What is Pypirc file?

A . pypirc file allows you to define the configuration for package indexes (referred to here as “repositories”), so that you don't have to enter the URL, username, or password whenever you upload a package with twine or flit.


2 Answers

In short, you cannot reupload a distribution with the same name due to stability reasons. Here you can read more about this issue at https://github.com/pypa/packaging-problems/issues/74.

You need to change the distribution's file name, usually done by increasing the version number, and upload it again.

like image 131
wolfsgang Avatar answered Sep 25 '22 07:09

wolfsgang


Yes you can reupload the package with same name.

I had faced similar issue what I did was increased the version number in setup.py and delete the folders generated by running python setup.py sdist i.e. dist and your_package_name-egg.info and again run the commands python setup.py sdist to make the package upload ready.

I think pypi tracks the repo from folder generated by sdist i.e. dist and your_package_name-egg.info so you have to delete it.

like image 37
Prince Roshan Avatar answered Sep 22 '22 07:09

Prince Roshan