400 错误:上传新 PyPI 包 (twine) 时 URI 无效

Bra*_*len 5 python pypi twine

我按照官方文档将包上传到 PyPI,以及 PyPI 自述文件中提供的信息,但每次都会收到 HTTP 400 错误:

$ twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/ 
Enter your username: bradaallen
Enter your password:
Uploading brad_nlp_helpers-0.1.1-py3-none-any.whl
HTTPError: 400 Client Error: home_page: Invalid URI for url: 
https://upload.pypi.org/legacy/
Run Code Online (Sandbox Code Playgroud)

我正在使用 ~/.pypirc

[distutils]
index-servers =
  pypi
  pypitest

[pypi]
username=bradaallen
password=[password]

[pypitest]
username=bradaallen
password=[password]
Run Code Online (Sandbox Code Playgroud)

对于包,我正在使用twine version 1.9.1 (pkginfo: 1.4.1, requests: 2.12.4, setuptools: 27.2.0, requests-toolbelt: 0.8.0, tqdm: 4.14.0)

当我使用时,python setup.py sdist bdist_wheel upload我遇到同样的问题:

Submitting dist\brad_nlp_helpers-0.1.1.tar.gz to
https://upload.pypi.org/legacy/ Upload failed (400): home_page: Invalid URI
error: Upload failed (400): home_page: Invalid URI
Run Code Online (Sandbox Code Playgroud)

我没有指定存储库,因为这是 API 在上传时给出的建议。我404 error在 PyPI 推荐的链接上看到了一个,但没有看到我应该使用的替代网站!

这是我的第一个包,我在互联网上的其他地方没有看到此错误。有什么想法:发生了什么事吗?

phd*_*phd 0

就在几分钟前尝试上传包时遇到了这个问题。:-) 要修复: 升级pipsetuptoolstwine到最新版本:

\n\n
pip install -U pip setuptools twine\n
Run Code Online (Sandbox Code Playgroud)\n\n

从以下位置删除或注释掉存储库~/.pypirc

\n\n
[distutils]\nindex-servers =\n    pypi\n\n[pypi]\n#repository: \nusername: \xe2\x80\xa6\n
Run Code Online (Sandbox Code Playgroud)\n\n

twine upload现在可以了!

\n