403客户端错误:使用麻线上传到Pypi时,身份验证信息无效或不存在

问题描述 投票:0回答:1

403客户端错误:使用Twine将新模块上传到pypi时,出现无效或不存在的身份验证信息] >>

Win10 Pro 1803 Biuld 17134.1069 64位// Python 3.7.5 32位// pip 19.3.1

我成功创建了tar。和。在dist文件夹中,在带有电子邮件确认的https://pypi.org/上注册并开始上传。

我用命令行('PASSED')检查了两个文件

并执行以下操作:

Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: gakonorde
Enter your password:
Uploading gersyll-Alpha.release-py3-none-any.whl
100%|█████████████████████████████████████████████████████████████████████████████| 6.43k/6.43k [00:01<00:00, 5.12kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/

命令行不允许我在用户名之后输入密码。我只能按Enter。

我也尝试过

Password for 'your-username' in 'https://upload.pypi.org/legacy/':

...再一次,我只能按Enter键。

然后我创建了具有https://pypi.org/及其测试版本凭据的。pypirc

文件,然后再次运行python -m twine upload dist/*

没有要求我输入密码,但出现相同的错误:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading gersyll-Alpha.release-py3-none-any.whl
100%|█████████████████████████████████████████████████████████████████████████████| 6.43k/6.43k [00:01<00:00, 5.46kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/

当我将。pypirc

与API令牌结合使用时,问题仍然相同。

我可以在https://pypi.org/上输入我的帐户,因此该帐户显然存在(并且已验证电子邮件)。

我还添加了第二封电子邮件,已验证并将其设置为主要(未更改)。

这是我的setup.py:

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="gersyll",
    version="Alpha release",
    author="gakonorde",
    author_email="[email protected]",
    description="This module counts the number of words of different syllable length for all texts in a directory",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/gakonorde/gersyll",
    packages=setuptools.find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3.7",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
    python_requires='>=3.7',
)

我在做什么错?

任何帮助将不胜感激。

编辑:

.pypirc文件与.setup,README,License,dict /等位于同一文件夹中。

其内容如下:

[distutils]
index-servers =
  pypi
  pypitest

[pypitest]
repository: testpypi.python.org/pypi
username: gakonorde 
password: [my_password]

[pypi]
repository: upload.pypi.org/legacy
username: gakonorde
password: [my_password]

403客户端错误:使用Twine Win10 Pro 1803 Biuld 17134.1069 64位// python 3.7.5 32位// pip 19.3.1 I ...]将新模块上传到pypi时,出现无效或不存在的身份验证信息。 >

已解决

python -m twine upload -u USERNAME -p PASSWORD dist/*

关于密码提示,在输入密码:提示之后,您将看不到任何输入,因为它隐藏了您的密码。

对于.pypirc文件,该文件应位于主目录(~/.pypirc)中,而不是与setup.py文件所在的目录中。

python upload http-status-code-403 pypi twine
1个回答
0
投票

已解决

python -m twine upload -u USERNAME -p PASSWORD dist/*

0
投票

关于密码提示,在输入密码:提示之后,您将看不到任何输入,因为它隐藏了您的密码。

对于.pypirc文件,该文件应位于主目录(~/.pypirc)中,而不是与setup.py文件所在的目录中。

© www.soinside.com 2019 - 2024. All rights reserved.