【发布时间】:2018-07-26 21:13:50
【问题描述】:
我一直在尝试将包上传到 PyPi。我每次都会收到这个错误。
Upload failed (403): Invalid or non-existent authentication information.
error: Upload failed (403): Invalid or non-existent authentication information.
我先google了一下,发现GitHub上有几个问题。我按照大家说的有效,没有骰子。
我制作了一个~/.pypirc 文件,内容如下,就像大家说的那样
[distutils]
index-servers =
pypi
[pypi]
username: shadeyg56
password:
我确实填写了密码部分,但显然我不会分享。 然后我跑了
python setup.py sdist upload
在正确的目录中,它返回了这个
running sdist
running egg_info
writing shades_package.egg-info\PKG-INFO
writing dependency_links to shades_package.egg-info\dependency_links.txt
writing top-level names to shades_package.egg-info\top_level.txt
reading manifest file 'shades_package.egg-info\SOURCES.txt'
writing manifest file 'shades_package.egg-info\SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst,
README.txt
running check
creating shades_package-0.1
creating shades_package-0.1\shades_package
creating shades_package-0.1\shades_package.egg-info
copying files to shades_package-0.1...
copying setup.py -> shades_package-0.1
copying shades_package\__init__.py -> shades_package-0.1\shades_package
copying shades_package\test.py -> shades_package-0.1\shades_package
copying shades_package.egg-info\PKG-INFO -> shades_package-0.1\shades_package.eg
g-info
copying shades_package.egg-info\SOURCES.txt -> shades_package-0.1\shades_package
.egg-info
copying shades_package.egg-info\dependency_links.txt -> shades_package-0.1\shade
s_package.egg-info
copying shades_package.egg-info\not-zip-safe -> shades_package-0.1\shades_packag
e.egg-info
copying shades_package.egg-info\top_level.txt -> shades_package-0.1\shades_packa
ge.egg-info
Writing shades_package-0.1\setup.cfg
Creating tar archive
removing 'shades_package-0.1' (and everything under it)
running upload
Password:
Submitting dist\shades_package-0.1.tar.gz to https://upload.pypi.org/legacy/
Upload failed (403): Invalid or non-existent authentication information.
error: Upload failed (403): Invalid or non-existent authentication information.
我似乎无法弄清楚它为什么这样做。如果有人知道请告诉我。谢谢:)
【问题讨论】:
-
您可能想改用twine -- 最近在上传工作方式方面发生了一些变化,旧的
setup.py upload可能不再有效
标签: python python-3.x pypi