当前位置:首页 » 《随便一记》 » 正文

Python pip install 安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法

15 人参与  2023年04月04日 09:29  分类 : 《随便一记》  评论

点击全文阅读


Python pip install 安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法

文章目录

Python pip install 安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法一、问题二、原因三、解决办法

一、问题

使用 pip 安装 python 包时,经常会出现如下错误:

ERROR: Could not find a version that satisfies the requirement xxxx(from versions: none)ERROR: No matching distribution found for xxxx

本次在用pip命令(pip install pdf2word)安装pdf2docx包的时候出错

因为后来安装好了,所以故意安装一个错误的pdf2word,来整个图

在这里插入图片描述

二、原因

可能是国内网络不稳定,直接导致报错,而不是环境冲突。报错信息看起来容易把人误导到解决包环境问题。

三、解决办法

直接选用稳定的pip源并且信任它的来源就可以解决这种问题

这里用的是阿里云镜像源

pip install pdf2docx -i http://mirrors.aliyun.com/simple/ --trusted-host mirrors.aliyun.com

在这里插入图片描述

其它镜像源:

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

使用方法:

例如,豆瓣

pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

注意:
如果你的环境里还有python的其他版本,要区分pip和pip3


点击全文阅读


本文链接:http://zhangshiyu.com/post/58273.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1