![](/img/trans.png)
[英]Again urllib.error.HTTPError: HTTP Error 400: Bad Request
[英]ERROR HTTPError: 400 Bad Request when building PyPi package
我正在尝试构建我的 PyPi package 并在运行此命令后python3 -m twine upload --verbose --repository testpypi dist/*
它给了我这个错误:
Response from https://test.pypi.org/legacy/:
400 '0+untagged.2.g592d0aa' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.
INFO <html>
<head>
<title>400 '0+untagged.2.g592d0aa' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.</title>
</head>
<body>
<h1>400 '0+untagged.2.g592d0aa' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.</h1>
The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
'0+untagged.2.g592d0aa' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.
</body>
</html>
ERROR HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
'0+untagged.2.g592d0aa' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.
我使用--verbose
来获取有关我的错误的更多信息。 对于我的 setup.py,我使用了以下版本:
setup(
name='fsa_test_one',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass()
问题出在versioneer
样式中,在setup.cfg
文件中找到,我将其更改为支持我的 package 的样式,即PEP440-pre
。 因此,在更改之后,我必须再次设置 versioneer,然后它才能工作。 我还必须确保我删除了存储在dist/*
目录中的所有以前的构建
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.