目录

一、问题: 

二、原因:

三、解决方法: 

四、常用的国内源:


一、问题: 

ERROR: Could not find a version that satisfies the requirement <软件包> (from versions: none)
ERROR: No matching distribution found for <软件包>

二、原因:

错误:找不到满足要求的版本<软件包>(来自版本:无)
错误:找不到匹配的<软件包>分布

三、解决方法: 

1.首先确保输入软件包名称版本号没有问题。

2.保证计算机连接网络。

3.更新pip

pip install --upgrade pip

4.更换pip源 

pip install <软甲包> -i https://pypi.tuna.tsinghua.edu.cn/simple/

5.采取国内镜像源试一下【临时生效】

pip install <软件包> -i http://pypi.douban.com/simple/

如果显示如下内容,表示不受信任。

WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'.

 解释:

警告:位于 pypi.douban.com 的存储库不是受信任或安全的主机,正在被忽略。如果此存储库可通过 HTTPS 使用,我们建议您改用 HTTPS,否则您可以屏蔽此警告,并允许使用“--trusted-host pypi.douban.com”。


“--trusted-host”表示信任。

pip install <软件包> -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

四、常用的国内源:

阿里云:http://mirrors.aliyun.com/pypi/simple/

清华大学:https://pypi.tuna.tsinghua.edu.cn/simple

中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban):http://pypi.douban.com/simple/

【永久生效】

修改 ~/.pip/pip.conf 文件。(如果没有就创建一个)

的话,直接使用vi命令编辑~/.pip/pip.conf文件就好.

vi ~/.pip/pip.conf

没有的话,开始创建~/.pip/pip.conf文件 

(1)创建.pip隐藏文件夹

mkdir ~/.pip 

 (2)创建pip.conf文件

touch ~/.pip/pip.conf

(3)vi命令编辑~/.pip/pip.conf文件

vi ~/.pip/pip.conf

编辑内容 

[global] 
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install] 
trusted-host = pypi.tuna.tsinghua.edu.cn

查看pip配置:

pip config list

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐