注册到 PyPi:基本身份验证失败

问题描述 投票:0回答:2

我不知道如何注册我的项目。我可以在 https://testpypi.python.org/pypi 正常登录,但在我的 .pypirc 中使用相同的凭据不起作用。

.pypirc

[distutils]
index-servers=
    test

[test]
repository = https://testpypi.python.org/pypi
username = <username>
password = <password>

<username>
<password>
替换为我用于在 testpypi 手动登录的凭据。

然后我尝试注册我的项目:

python setup.py register -r test

输出

running register
running egg_info
writing websocket_server.egg-info/PKG-INFO
writing top-level names to websocket_server.egg-info/top_level.txt
writing dependency_links to websocket_server.egg-info/dependency_links.txt
reading manifest file 'websocket_server.egg-info/SOURCES.txt'
writing manifest file 'websocket_server.egg-info/SOURCES.txt'
running check
Registering myproject to https://testpypi.python.org/pypi
Server response (401): basic auth failed

知道发生了什么事吗?我到处找,但关于如何解决此类问题的信息似乎很少。

python-2.7 distutils setup.py pypi cheeseshop
2个回答
5
投票

您需要点击电子邮件中的链接来完成注册。


0
投票

如果您使用令牌,您的用户名应该是

__token__
我已经研究了至少四个小时,然后发现了本指南,其中提到了用户名检查。 https://pypi.org/help/#invalid-auth

© www.soinside.com 2019 - 2024. All rights reserved.