A guide for updating packages on PyPi

拜拜、爱过 提交于 2019-12-18 13:24:49

问题


I used this guide to install a new package on PyPi.

Now, I want to update the package. Since I found no guide for this, I tried to do it myself: I updated the version from "1.0.0.dev1" to "1.0.0.dev2" and re-installed. It did not work: I got:

Uploading tee_table-1.0.0.dev1-py3-none-any.whl

HTTPError: 400 Client Error: File already exists. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/

I also read this question but the information seems outdated (from 2012).

Is there a simple user guide that describes how to upload a new version of a package to PyPi?


回答1:


I found out what my problem was - I did not delete the old files in the dist folder, so the uploader tried to upload them before the new files, and failed. The solution was to:

a. Delete all files in the dist folder.

b. Update the version number in the setup.py file.

c. Re-create the wheels:

python3 setup.py sdist bdist_wheel

d. Re-upload the new files:

twine upload dist/*


来源:https://stackoverflow.com/questions/52700692/a-guide-for-updating-packages-on-pypi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!