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

简介: 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 即可。

相关文章
|
IDE PyTorch 网络安全
|
7月前
|
SQL 人工智能 自然语言处理
【重要通知】新老版本均可用!JeecgBoot低代码正式接入 AI Skills,一句话生成整套系统
JeecgBoot低代码平台正式推出AI技能体系(Skills),结合Claude Code强大的AI编程能力,提供零代码和代码生成两种模式,让一句话搭建系统成为现实。支持表单设计、流程配置、报表搭建等端到端交付。
824 3
【重要通知】新老版本均可用!JeecgBoot低代码正式接入 AI Skills,一句话生成整套系统
|
11月前
|
Ubuntu Linux
查看Ubuntu版本的方法:
无论您是系统管理员还是普通用户,以上几种方法都可以很快地提供您所需的系统版本信息,并可以帮助您在需要进行系统升级或是向技术专家报告问题时,快速准确地提供系统详情。
2390 7
|
并行计算 PyTorch Linux
大概率(5重方法)解决RuntimeError: CUDA out of memory. Tried to allocate ... MiB
大概率(5重方法)解决RuntimeError: CUDA out of memory. Tried to allocate ... MiB
14914 0
|
Python
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)
1722 1
|
安全 关系型数据库 文件存储
删除的文件不在回收站?为什么?
你是否遇到过文件删除后不进回收站的情况?本文解析5大常见原因及应对方法,助你避免误删重要文件,提升数据安全意识。
|
Python
pandas包的安装和Could not find a version that satisfies|9
pandas包的安装和Could not find a version that satisfies|9
1390 8
|
开发者 Python
【Python】已完美解决:ERROR: Could not find a version that satisfies the requirement re
【Python】已完美解决:ERROR: Could not find a version that satisfies the requirement re
3600 0
|
API
No module named 'plotly.graph_objects'问题解决
No module named 'plotly.graph_objects'问题解决
875 0
No module named 'plotly.graph_objects'问题解决