Solution for Could not find a version that satisfies the requirement pyopenssl

问题

pip install pyopenssl ndg-httpsclient pyasn1

使用pip执行如上命令安装library时报错如下:

Could not find a version that satisfies the requirement pyopenssl (from versio ns: ) No matching distribution found for pyopenssl

分析

此错误的最可能原因是:

  1. 因为PyPI服务器已将您的IP地址列入黑名单,因此未响应您的请求。
    这可以通过将代理与pip一起使用来解决。请参阅解决方案

  2. 或者是因为你在运行一个旧的pip(特别是在mac上)。这可以通过升级pip来解决。

  3. 这也可能是因为pypi服务器已关闭。

 

解决方案

windows下pip配置代理,可以解决这个问题。

  1. 点击此电脑,在最上面的的文件夹窗口输入 : %APPDATA%
  2. 按回车跳转到目标目录,在此目录下新建pip文件夹。
  3. 在pip文件夹下创建pip.ini文件(注意如果用记事本创建,要删除末尾的".txt")。
  4. 打开.ini文件,输入以下内容,关闭即可(注意:源镜像可替换)。

[global]

imeout = 6000

index-url = http://pypi.douban.com/simple

trusted-host = pypi.douban.com

国内源镜像有:

V2EX:http://pypi.v2ex.com/simple
豆瓣:http://pypi.douban.com/simple
中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple/
清华:https://pypi.tuna.tsinghua.edu.cn/simple

配置好代理后,再次执行指令运行成功如下图所示。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值