奇怪的PyPI身份验证行为

时间:2009-11-17 16:47:04

标签: python distribution distutils pypi

我正在尝试将我的包上传到PyPI。它要求我确定,我这样做,它给出了一个OK响应(除非识别是正确的,否则不会发生),但它声称我没有识别!为什么呢?

[...]
removing 'build\bdist.win32\egg' (and everything under it)
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: coolRR
Password:
Server response (200): OK
running upload
Submitting dist\garlicsim-0.1.zip to http://pypi.python.org/pypi
Upload failed (401): You must be identified to edit package information
removing 'build' (and everything under it)
error: garlicsim-0.1: No such file or directory

2 个答案:

答案 0 :(得分:1)

我自己从来没有遇到过,但有些事要检查:

  1. 确保您可以使用浏览器使用用户名和密码登录PyPI。
  2. 检查〜/ .pypirc是否包含正确的内容。如果它不存在,请尝试创建它。
  3. 检查setup.cfg文件以确保所有PyPI设置(如果有)都正确。
  4. 在运行上传/注册命令之前,尝试将包构建为单独的检查,然后尝试python setup.py upload。

答案 1 :(得分:1)

您使用的是旧版本的Python(结果是Distutils)。此错误已在Tarek Ziade的r68415 2009-01-09中修复。尝试使用之后发布的任何Python 2.x版本上传。