更新pip.conf文件以使用https

Dee*_*end 7 python pip

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

我有一个相关的问题发布PIP无法找到满足SQLAlchemy要求的任何下载,其中有几个人诊断出了什么问题.但是我无法解决问题.

我打开我的pip.conf文件位于/home/user/.pip/pip.conf使用pip配置文件文档我添加了下面.文件中没有其他内容.

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

[install]
find-links = https://pypi.python.org/simple/
Run Code Online (Sandbox Code Playgroud)

保存退出后没有变化.我仍然无法运行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 
Run Code Online (Sandbox Code Playgroud)

我的设置

  • Ubunto 12.04 VM

Mid*_*ter 10

您应该使用index-url = https://pypi.python.org/simple/而不是find-links在配置中使用.这将取代默认值而不是仅添加另一个选项(这是什么find-links).


小智 5

来自最新指南:https : //pip.pypa.io/en/stable/user_guide/#config-file

新的默认配置文件是: $HOME/.config/pip/pip.conf

每个用户的旧版配置文件,该文件也受到尊重:

在Unix和macOS上,配置文件为: $HOME/.pip/pip.conf