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

你可能感兴趣的:(Python,python)