pyspark--完美解决 Could not find a version that satisfies the requirement 安装包名字 (from versions: )

本文涉及的产品
实时计算 Flink 版,5000CU*H 3个月
智能开放搜索 OpenSearch行业算法版,1GB 20LCU 1个月
实时数仓Hologres,5000CU*H 100GB 3个月
简介: pyspark--完美解决 Could not find a version that satisfies the requirement 安装包名字 (from versions: )

完美解决 Could not find a version that satisfies the requirement 安装包名字 (from versions: )


大家在刚开始使用python 时会遇到缺少python 库的问题,提示 No module named ’ 安装包名字’ 问题

在解决安装包问题中在网上找了很多的方法,方法很多各种各样,对一部分人有用,对一部分没有用,下面对这些方法做了整理,希望可以节省大家查问题解决问题的时间。

这时候根据No module named ’ 安装包名字’ 百度查解决方法,方法有很多,比如

方法一:pip install 安装包名字

方法二:python -m pip install 安装包名字

方法三:pip --trusted-host pypi.python.org install 安装包名字

这时候部分人会解决,但是还是会出现新的报错

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:852)’),)’: /simple/six/
Could not fetch URL https://pypi.org/simple/six/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/six/ (Caused by SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:852)’),)) - skipping
Could not find a version that satisfies the requirement 安装包名字(from versions: )
No matching distribution found for 安装包名字

接着继续根据Could not find a version that satisfies the requirement 安装包名字 查问题

会提示换成国内的pip源 可以解决问题

方法一:pip install 安装包名字 -i http://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com //豆瓣镜像网站

方法二:pip install 安装包名字 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com //豆瓣

方法三:pip install 安装包名字 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn //清华大学

还有下面几个国内pip 源,大家可以依次按照上面的方法试下

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

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

3) http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学

这时候也会有部分人解决了问题,下载安装成功,问题解决了的可以不用往下看了,如果还是有问题的可以继续。

方法一:再继续查,提示跟环境和版本有关,环境不支持32位的,如果是32位就换成64位的python,还有版本要在3.7 以下,降成3.6和3.5都可以,我的环境是64位的,降成3.6 版本后试了下无效,但是大家可以试下,可能有效。

方法二:也就是最终的解决办法,自己下python 库,在http://pypi.doubanio.com/simple/ 这个镜像网站中包含了所有的常见库,需要哪个就直接下载,在安装库中也会报错,这时候你需要查看pip支持的哪些符号,运行如下命令:

1、amd64:cpu是x64的,(注意并不是指操作系统是64位的)用如下代码查看

import pip._internal

print(pip._internal.pep425tags.get_supported())

2、win32:指Windows操作系统,用如下代码查看

import pip

print(pip.pep425tags.get_supported())

如果出现如下错误说明用错了命令,用上面两个命令中的另一个就行了。

命令运行成功后可以看到如下信息:

出现了pip支持的符号

[(‘cp36’, ‘cp36m’, ‘win_amd64’), (‘cp36’, ‘none’, ‘win_amd64’), (‘py3’, ‘none’, ‘win_amd64’), (‘cp36’, ‘none’, ‘any’), (‘cp3’, ‘none’, ‘any’), (‘py36’, ‘none’, ‘any’), (‘py3’, ‘none’, ‘any’), (‘py35’, ‘none’, ‘any’), (‘py34’, ‘none’, ‘any’), (‘py33’, ‘none’, ‘any’), (‘py32’, ‘none’, ‘any’), (‘py31’, ‘none’, ‘any’), (‘py30’, ‘none’, ‘any’)]

我们需要看我们所下载的离线文件名字符号为(‘cp36’,’cp36m’,‘win_amd64’)在不在支持的列表中。如果不在的话就会安装失败,大家下载对应pip支持符号就可以了。

下载的安装文件 执行指令pip install xxxx.whl 就可以,如果下载的是xxxx.zip 包,将包解压,把文件直接放到python 安装路径下 xxxx\Python\Python36\Lib 即可。

目录
打赏
0
8
9
1
64
分享
相关文章
Building wheel for opencv-python (pyproject.toml) ,安装命令增加 --verbose 参数
Building wheel for opencv-python (pyproject.toml) ,安装命令增加 --verbose 参数
357 2
pip安装包报错Could not find a version that satisfies the requirement pymysql (from versions: none)
pip安装包报错Could not find a version that satisfies the requirement pymysql (from versions: none)
875 1
|
8月前
|
npm install 报错 import sys; print“%s.%s.%s”% sys.version_info[ :3] ;
npm install 报错 import sys; print“%s.%s.%s”% sys.version_info[ :3] ;
255 3
update-alternatives --config python 为什么不能使用
【6月更文挑战第14天】update-alternatives --config python 为什么不能使用
162 1
|
8月前
|
安装 supervisor报错执行python setup.py install时No local packages or working download links found for meld3
安装 supervisor报错执行python setup.py install时No local packages or working download links found for meld3
89 0
【Python】已完美解决:(pip提示升级)WARNING: There was an error checking the latest version of pip.,
【Python】已完美解决:(pip提示升级)WARNING: There was an error checking the latest version of pip.,
1635 0
conda 常用命令, Non-zero exit code,You will need to adjust your conda configuration
conda 常用命令, Non-zero exit code,You will need to adjust your conda configuration
Hadoop【问题记录 03】【ipc.Client: Retrying connect to server:xxx/:8032+InvalidResourceRequestException】解决
【4月更文挑战第2天】Hadoop【问题记录 03】【ipc.Client: Retrying connect to server:xxx/:8032+InvalidResourceRequestException】解决
584 2
|
10月前
|
appium 安装 uiautomator2-server-debug-androidTest.apk 、appium-uiautomator2-server-v5.12.16.apk 失败的解决办法
appium 安装 uiautomator2-server-debug-androidTest.apk 、appium-uiautomator2-server-v5.12.16.apk 失败的解决办法
429 0