gpt4 book ai didi

python - 在 OpenShift 上使用 pip 安装 Git 托管的模块

转载 作者:太空宇宙 更新时间:2023-11-03 21:23:07 25 4
gpt4 key购买 nike

我有一个项目,其requirements.txt与此类似:

-e git+https://some.gitlab.com/some_group/some_repo#egg=repo
selenium
pywinauto

我使用我的用户名和密码在 OpenShift 上创建了源 secret 并开始构建。克隆项目成功,但克隆 some_repo 失败并出现错误:“找不到用户名”。

我有 pip 困惑,因为主项目已使用 key 中提供的凭据成功克隆,但 Pip 似乎并未重用这些凭据。

更令人困惑的是,OpenShift 似乎将凭据存储在 .gitconfig 文件中,Pip 应该知道该文件:

I0107 15:35:14.756570       1 password.go:84] Adding username/password credentials to git config:
# credential git config
[credential]
helper = store --file=/tmp/gitcredentials.324456941

有什么想法吗?

附注我想尝试使用 SSHKey,但由于某种原因,管理员不想在公司的 GitLab 上启用此选项。而且我不想在 requests.txt 内的 url 中添加一些凭据。

编辑:我在我的工作站上没有任何问题

最佳答案

如果您不使用 ssh key ,pip 希望您将用户名和密码添加为 URL 的一部分。您可以将 secret 设置为环境变量,并在 pip.conf 中引用它们。

[global]
index = https://$username:$password@some.gitlab.com/some_group/some_repo

关于python - 在 OpenShift 上使用 pip 安装 Git 托管的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54077862/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com