• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

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

武飞扬头像
Lucas_coding
帮助1

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 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

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgfihhb
系列文章
更多 icon
同类精品
更多 icon
继续加载