pip - Travis CI 的 PyPi 部署:身份验证无效或不存在
问题描述
通过 Travis CI 部署到 PyPi 时,出现以下错误:
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://upload.pypi.org/legacy/
我已经按照 Travis CI 文档进行pypi 部署,并设置了我的 PyPI 用户名和密码,后者根据密码加密文档进行了加密。密码没有任何值得转义的字符,但无论如何我都尝试转义所有字符。
似乎没什么用,有什么建议吗?
Travis CI 配置的相关部分是:
- provider: pypi
on:
branch: master
tags: true
user: "<<username>>"
password:
secure: "<<encrypted password>>"
distributions: "sdist bdist_wheel"
skip_existing: true
编辑
在 Travis 运行之前preparing deploy
,deploying the application
它似乎已成功验证。然而,当它完成上传时,它会引发 403 invalid auth 错误:
Installing deploy dependencies
...
Authenticated as <<username>>
Preparing deploy
...
Deploying application
...
Uploading distributions to https://upload.pypi.org/legacy/
Uploading example-package-py3-none-any.whl
100%|██████████| 41.0k/41.0k [00:00<00:00, 90.3kB/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/
解决方案
在联系travis-ci
支持人员后,他们注意到存储库首先存在travis-ci.org
于travis-ci.com
. 这为身份验证带来了问题。
解决方案是明确travis encrypt
运行travis-ci.com
:
travis encrypt <<password>> --com --debug
调试标志显然是可选的,并在终端中提供了一些附加信息。
推荐阅读
- node.js - 通过 id 对 RabbitMQ 消息进行分组以同步处理它们
- android - Firebase 单值事件监听器每次都返回 null
- javascript - 社区版中的 ag-grid 客户端行模型 - 不像官方文档那样表现
- apache-spark - Spark读取具有多种记录类型的文件
- java - 这个实例变量是否“隐藏”?
- python-3.x - discord.py 错误 - ClientConnectorCertificateError
- laravel-backpack - 如何在 Backpack 中查看列表视图后面的 AJAX 查询?
- testing - 使用记者时,Testcafe 进程无法结束
- grep - 我怎样才能只列出目录名称,没有尾随“/”?
- javascript - 为什么 Javascript 会这样?