views:

279

answers:

2

When running..

python setup.py sdist register upload

..I get the following output:

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: example
Password: ...
Registering mypackage to http://pypi.python.org/pypi
Server response (200): OK
I can store your PyPI login so future submissions will be faster.
(the login will be stored in /Users/dbr/.pypirc)
Save your login (y/N)?y
running upload
Submitting dist/mypackage-1.2.1.tar.gz to http://pypi.python.org/pypi
Upload failed (401): You must be identified to edit package information

It's prompting to save the login details, despite ~/.pypirc already containing this. It then fails to upload files for a package I own, and have full write-access to.

+6  A: 

Just found this page, which solves the issue:

I also noticed that while it was asking me to save my login information, and I hit Y everytime, it still asked me for the username and password. It turned out that it was saving the information incorrectly as follows:

[pypi]
username:dcramer
password:*******

Changing it out to this solved the problems:

[server-login]
username:dcramer
password:********

Ugh.. I think this may be a good time to give distribute a try..

dbr
This fix worked for me too, thanks. Looks like a bug in distutils?
Chris Miles
@Chris Quite likely.. Haven't noticed it lately (might be fixed), but I haven't been using distutils much recently
dbr
A: 

Same bug is in setuptools for 2.7. Try to use Python 2.6.

DenisKolodin