Python在使用pip安装某个库时报错 Could not find a version that satisfies the requirement numpy

问题描述:Python中在使用pip的下述命令安装第三方库numpy

pip install -U numpy -i http://mirrors.aliyun.com/pypi/simple

出现警告The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored,并且报错 Could not find a version that satisfies the requirement numpy (from versions: none)

解决方法:出现这个问题的原因是pip升级到7.0以后,pip包管理工具直接从镜像源下载相关的依赖库时,所需要的镜像源必须是HTTPS协议的网络地址,不能直接从非HTTPS协议的镜像源地址下载依赖库。如果想从非HTTPS协议的镜像源地址下载依赖库,在使用pip命令下载依赖库的时候需要添加--trusted-host 域名配置

pip install -U numpy -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

使用上述命令再次下载numpy依赖库,可以看到已经下载成功 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值