无法使用Twine上传到PyPi [英] Can't upload to PyPi with Twine
问题描述
我正在尝试使用以下命令将python软件包上传到PyPi:
I'm trying to upload a python package to PyPi, using the following commands:
pip install -e .
python setup.py bdist_wheel --universal
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
我收到此错误:
HTTPError:403客户端错误:验证信息无效或不存在.网址: https://upload.pypi.org/legacy/
我还尝试了以下命令:
twine upload dist/*
twine upload --repository-url pypi dist/*
twine upload --repository-url https://upload.pypi.org/legacy dist/*
python setup.py bdist_wheel --universal upload
.pypirc文件位于同一目录中,我正在运行以下命令:
with a .pypirc file located in the same directory I'm running the commands from which is:
[distutils]
index-servers =
pypi
pypitest
[pypitest]
repository: https://testpypi.python.org/pypi/
username: <username>
password: <password>
[pypi]
repository: https://upload.pypi.org/legacy/
username: <username>
password: <password>
但是我仍然被要求输入密码. (也在pypitest上创建了帐户后,也使用pypitest尝试了此操作,但得到了相同的错误)
But I'm still asked for my password. (Also tried this using pypitest, after creating an account on there too, but get the same error)
我也尝试过相同的操作,但是删除了存储库行.
I've also tried doing the same but with the repository line removed.
The package name I'm trying to upload used to be occupied, but it has been removed now - https://pypi.python.org/pypi?name=&version=1.0.0&:action=display says that the package is not found
我使用的用户名和密码与成功登录 https所使用的用户名和密码相同://pypi.python.org/pypi?%3Aaction = login_form
The username and password I'm using are the same I use to successfully log in to https://pypi.python.org/pypi?%3Aaction=login_form
推荐答案
我使用的帐户似乎出现某种错误.以下步骤为我修复了此问题:
It looks like some sort of error with the account I was using. The following steps fixed it for me:
- 创建一个新帐户
- 使用
twine upload dist/*
用新帐户上传软件包
- 以所有者身份将以前的帐户(您最初想与之一起上传)添加到软件包中
- Create a new account
- Upload the package with the new account with
twine upload dist/*
- Add the previous account (that you originally wanted to upload with) to the package as an owner
还请注意,测试pypi服务器--repository-url https://test.pypi.org/legacy/
要求创建与实时服务器--repository-url https://upload.pypi.org/legacy/
Also be aware that the test pypi server --repository-url https://test.pypi.org/legacy/
, requires a different account to be created from the live server --repository-url https://upload.pypi.org/legacy/
这篇关于无法使用Twine上传到PyPi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!