如何在启用两个因素的情况下将包上传到 PyPi? [英] How to upload package to PyPi with Two Factor enabled?

查看:48
本文介绍了如何在启用两个因素的情况下将包上传到 PyPi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个包上传到 Pypi,所以我创建了一个帐户并尝试按照手册进行操作.

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

  1. 帐户:

看起来我无法直接从 pypi.org 创建项目:

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

  1. 我安装了 twine 并且我做到了

$ python3 -m twine upload dist/*

$ python3 -m twine upload dist/*

这次我有以下错误:

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

也许这与我的双因素身份验证有关.我也很好奇他在那里使用的 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...

推荐答案

来自 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.

您可以改用 API 令牌.

这篇关于如何在启用两个因素的情况下将包上传到 PyPi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆