"setup.py upload" does not work with "Download error" (401): you must be identified to edit package information "

At startup.

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 

He suggests saving login details even though ~/.pypirc already contains this. Then it cannot upload files for the package that I have, and have full write access.

+46
python setuptools packaging
Oct 14 '09 at 10:15
source share
7 answers

Just found this page that solves the problem:

I also noticed that although he asked me to save my login information and I hit Y every time, she still asked me about the username and password. It turned out that he incorrectly stores the information as follows:

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

By changing this, we solved the problems:

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

The above content is located in the .pypirc file in the user 's home directory.

Uh .. I think this might be the right time to give distribute a try.

+62
Oct 14 '09 at 22:19
source share

None of the changes to ~ / .pypirc listed here worked for me.

This worked for me, with no changes to ~ / .pypirc. I added "-r https://www.python.org/pypi " on the command line:

 python setup.py register sdist upload -r https://www.python.org/pypi 

My ~ / .pypirc is as follows

 [distutils] index-servers: pypi [pypi] username: dlink password: ******** (the real one) 
+18
Jun 18 '16 at 17:25
source share

I have the same problem, this is my solution.

The python version is 2.7.7, the Windows version is Windows 7-6.1.7601-SP1.

here is my .pypirc file

 [distutils] index-servers=pypi [pypi] repository = https://pypi.python.org/pypi [server-login] username = user password = password 

Note:

In windows, the file is not allowed with the name ".pypirc", plz, see:

Rename files for empty file name in Windows

Then put the file ".pypirc" in the same folder with "setup.py"

Finally:

run:

 python setup.py sdist upload 

or

 python setup.py sdist register upload 

Hope this helps, thanks!

+4
Dec 19 '14 at 3:10
source share

I have this problem and solve it by placing the .pypirc file in my home directory (~ /), as the past of the first comment shows.

I did not need to change the name of the pypi section of the pypirc file to server-login, as was also suggested in the first comment.

+1
Apr 01 '15 at 11:16
source share

I changed [distutils] to [pypirc] according to docs and it worked for me.

Here is my ~/.pypirc :

 [pypirc] index-servers = pypi pypitest [pypi] repository=https://pypi.python.org/pypi [pypitest] repository=https://testpypi.python.org/pypi [server-login] username:stav password:**** 
0
Mar 28 '16 at 18:07
source share

I had this problem due to my own mistake, but hopefully it can help someone else who makes the same mistake.

I use python 3 on Linux Ubuntu, during registration I issued a configuration command using sudo! As a result, the .pypirc file in my home directory was owned by root and was not readable when I tried to load the module immediately after the user had no privileges.

By changing the ownership of the file to itself, the problem was resolved.

0
Dec 10 '16 at 17:27
source share

I ran into the same problem. I am in the new X Sierra OS. Adding the [server-login] entry to ~ / .pypirc seemed to fix it

http://www.seanbehan.com/how-to-fix-pypi-upload-failed-403-invalid-or-non-existent-authentication-information/

-one
Mar 02 '17 at 22:04 on
source share



All Articles