gpt4 book ai didi

python - 更新 pip.conf 文件以使用 https

转载 作者:太空狗 更新时间:2023-10-29 21:24:19 28 4
gpt4 key购买 nike

我无法配置我的 pip.conf 文件来规定 PIP 应该从 https://pypi.python.org/simple/而不是 http://pypi.python.org/simple/

我发布了一个相关问题 PIP Could not find any downloads that satisfy the requirement SQLAlchemy几个人诊断出了什么问题。但是,我在制定解决方案时遇到了麻烦。

我使用 pip config file documentation 打开位于 /home/user/.pip/pip.conf 的 pip.conf 文件我添加了以下内容。文件中没有其他内容。

[global]
timeout = 60
find-links = https://pypi.python.org/simple/

[install]
find-links = https://pypi.python.org/simple/

保存退出后没有变化。我仍然无法运行诸如 pip install 之类的命令

$ sudo pip install SQLAlchemy
Downloading/unpacking SQLAlchemy
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement SQLAlchemy
No distributions at all found for SQLAlchemy
Storing complete log in /home/user/.pip/pip.log

我的设置

  • Ubuntu 12.04 虚拟机

最佳答案

您应该在配置中使用 index-url = https://pypi.python.org/simple/ 而不是 find-links。这将替换默认值,而不仅仅是添加另一个选项(find-links 所做的)。

关于python - 更新 pip.conf 文件以使用 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24353459/

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