PyPi 问题 - 上传失败 (401):必须验证身份才能编辑包信息

48 投票
1 回答
13867 浏览
提问于 2025-04-16 04:28

我遇到了一个和相关的问题,跟这个很像,不过我是在Windows系统上,而那个解决方案的页面现在无法访问。

有没有人知道该怎么解决这个问题?我正在使用Python 2.5。

python setup.py sdist register upload

running register
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]:  1
Username: tschellenbach
Password:
Server response (200): OK
running upload
Submitting dist\django-ogone-1.0.0.zip to http://pypi.python.org/pypi
Upload failed (401): You must be identified to edit package information

1 个回答

55

这个问题的答案似乎并不是特别针对Windows系统,试试看这个方法吧:被接受的答案。它的意思是,你需要一个名为 .pypirc 的文件,里面要有以下内容:

[server-login]
username:tschellenbach
password:******** (the real one)

另外,这是相关的文档(关于 .pypirc 的):

在Windows系统上,你需要设置一个名为HOME的环境变量,指向这个文件所在的目录。

撰写回答