“setup.py upload” is failing with “Upload failed (401): You must be identified to edit package information”

大城市里の小女人 提交于 2019-11-29 21:15:56
dbr

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:********

The above content goes into the .pypirc file in the user's home directory.

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

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" to the command line:

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

My ~/.pypirc looks like this

[distutils]
index-servers: pypi

[pypi]
username: dlink
password: ******** (the real one)
kongyue

I have the same problem, This is my solution.

The python version is 2.7.7, my 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

Notice:

In windows, A file is not allowed named as “.pypirc”,plz,refer to:

Rename files to empty filename in Windows

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

At last:

run :

python setup.py sdist upload

or:

python setup.py sdist register upload

I hope this will be help,thank you!

I have this problem and solved it by putting the file .pypirc under my home directory (~/), as the last past of the first comment suggests.

I didn't have the need to modify the name of the section "pypi" of the file pypirc for "server-login", as suggested also in the first comment.

I changed [distutils] to [pypirc] as per the docs and this worked for me.

Here is my ~/.pypirc file:

[pypirc]
index-servers =
    pypi
    pypitest

[pypi]
repository=https://pypi.python.org/pypi

[pypitest]
repository=https://testpypi.python.org/pypi

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

I had this problem, due to my own fault but hopefully this may help someone else who makes this same mistake.

I'm using python 3 on Linux Ubuntu, during registration I issued the setup command using sudo! The result was the .pypirc file in my home directory was owned by root and wasn't readable when trying to perform a module upload immediately after as a none privileged user.

By changing the ownership of the file to myself, the issue was resolved.

I ran into the same problem. I'm on a new OS X Sierra. Adding [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/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!