pip intsall 安装报错 ERROR: Could not find a version that satisfies the requirementi

1.使用pip install 包名: 出现问题和警告

pip install transformers

可能出现的错误1:
警告信息:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLZeroReturnError(6, ‘TLS/SSL connection has been closed (EOF) (_ssl.c:1131)’))’: /simple/pyopenssl/
Could not fetch URL https://pypi.org/simple/pyopenssl/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/pyopenssl/ (Caused by SSLError(SSLZeroReturnError(6, ‘TLS/SSL connection has been closed (EOF) (_ssl.c:1131)’))) - skipping
错误的信息:
ERROR: Could not find a version that satisfies the requirement pyOpenSSL (from versions: none)
ERROR: No matching distribution found for pyOpenSSL
在这里插入图片描述
可能出现的错误2:
ValueError: check_hostname requires server_hostname
在这里插入图片描述

2.百度发现了很多博客总结了一些方法。

问题的产生: 我之前就遇到了这个问题,
第一次出现问题的原因是因为我先使用 pip uninstall 包名x,然后在使用 pip install 包名x 然后出现的这个问题 那个没有解决之后重装了anaconda.
这里出现问题是因为我运行程序的时候下载预训练模型的时候感觉网速比较慢中途终止了程序,然后开启的 vpn (重点重点 圈起来要考的) 加速, 然后再次使用pip install 的时候遇上了如上的我问题。 所以这次我不想再次重装anaconda. 要处理他。
首先我这两次出现这个问题都是因为开启的代理服务器 VPN, 所以只要把刚刚所开启的代理服务器关闭即可解决

解决pip install 安装报错方法(最好是先把代理代理关掉)

方法1: 把代理服务器关掉

把代理服务器关掉可以解决 这个方法也可以解决, pip安装错误 ValueError: check_hostname requires server_hostname
在这里插入图片描述

方法2: 使用临时的源安装(这种方法适合一次性使用)

使用临时的源安装(这种方法适合一次性使用)
以豆瓣安装transformer包为例, --trusted-host 不要省略

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

使用格式为

pip install 包名 -i 源名 --trusted-host 源的网址

一些其他的源

清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/

方法3: 永久的更换源的方法

永久的更换源的方法
配置文件自动调取默认的源,
Windows 系统:
直接在user目录中创建一个pip文件,如:C:\Users\xx\pip,新建文件pip.ini
在这里插入图片描述
Linux 系统
修改 ~/.pip/pip.conf(没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹), 编辑完之后 ESC:, wq!保存退出

vim ~/.pip/pip.conf

上述文件建立完后添加如下内容:

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

参考博客:https://blog.csdn.net/thenorther/article/details/104376561
参考博客:https://blog.csdn.net/u010741112/article/details/115907497

  • 23
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
根据引用和引用,"ERROR: Could not find a version that satisfies the requirement pyqt (from versions: none) ERROR: No matching distribution found for pyqt"这个错误是由于找不到满足pyqt的版本导致的,没有找到匹配的发行版本。 要解决这个问题,你可以尝试以下几种方法: 1. 确保你的网络连接正常,并且能够访问软件源。有时候下载软件包需要连接到特定的软件源,如果网络不稳定或者无法连接到软件源,就会导致找不到匹配的发行版本。你可以尝试重新连接网络,或者更换一个稳定的网络环境。 2. 检查你的环境和依赖项。确保你正在使用的操作系统和Python版本与pyqt的要求相匹配。同时,还要检查是否已经安装了pyqt的依赖项,如sip。 3. 更新你的包管理器和软件源。有时候,包管理器和软件源可能会过时或者不完整,导致找不到满足要求的版本。你可以尝试更新你的包管理器,并添加或更换合适的软件源。 4. 手动安装pyqt。如果以上方法都无法解决问题,你可以尝试手动从官方网站下载pyqt的安装包,并按照官方文档提供的安装步骤进行安装。 请注意,这些方法可能因个人环境的不同而有所差异。如果问题仍然存在,建议你查阅官方文档、社区论坛或寻求专业人士的帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [解决ERROR:Could not find a version that satisfies the requirement torch-fx ......found for torch-fx](https://blog.csdn.net/ZHUO__zhuo/article/details/130457145)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [关于python pyqt5安装失败问题的解决方法](https://download.csdn.net/download/weixin_38700779/13762879)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)解决方案](https://blog.csdn.net/weixin_43178406/article/details/130536747)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值