How to upload package to PyPi with Two Factor enabled?

泄露秘密 提交于 2021-01-27 11:58:10

问题


I would like to upload a package to Pypi so I have created an account and tried to follow the manual.

  1. Account:

It looks I cannot create projects from pypi.org directly:

  1. I installed twine and I did

    $ python3 -m twine upload dist/*

This time I have the following error:

HTTPError: 403 Client Error: Invalid or non-existent 
authentication information. for url: https://upload.pypi.org/legacy/

Perhaps this is related to my Two Factor Authentication. I am also curious about he legacy word used there.

If I disable the Two Factor Authentication it works...


回答1:


From https://pypi.org/help/#twofa:

Users who have chosen to set up two factor authentication will be asked to provide their second method of identity verification during the log in process. This only affects logging in via a web browser, and not (yet) package uploads.

You can use API tokens instead.



来源:https://stackoverflow.com/questions/57506394/how-to-upload-package-to-pypi-with-two-factor-enabled

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