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

本文涉及的产品
RDS DuckDB + QuickBI 企业套餐,8核32GB + QuickBI 专业版
简介: 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 网络安全
|
3月前
|
SQL 人工智能 自然语言处理
【重要通知】新老版本均可用!JeecgBoot低代码正式接入 AI Skills,一句话生成整套系统
JeecgBoot低代码平台正式推出AI技能体系(Skills),结合Claude Code强大的AI编程能力,提供零代码和代码生成两种模式,让一句话搭建系统成为现实。支持表单设计、流程配置、报表搭建等端到端交付。
449 3
【重要通知】新老版本均可用!JeecgBoot低代码正式接入 AI Skills,一句话生成整套系统
完美解决->“pip : 无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。”
完美解决->“pip : 无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。”
完美解决->“pip : 无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。”
|
并行计算 PyTorch Linux
大概率(5重方法)解决RuntimeError: CUDA out of memory. Tried to allocate ... MiB
大概率(5重方法)解决RuntimeError: CUDA out of memory. Tried to allocate ... MiB
13411 0
|
人工智能 数据处理 语音技术
Pipecat实战:5步快速构建语音与AI整合项目,创建你的第一个多模态语音 AI 助手
Pipecat 是一个开源的 Python 框架,专注于构建语音和多模态对话代理,支持与多种 AI 服务集成,提供实时处理能力,适用于语音助手、企业服务等场景。
1602 23
Pipecat实战:5步快速构建语音与AI整合项目,创建你的第一个多模态语音 AI 助手
|
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)
1588 1
|
开发者 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
3481 0
|
Python
pandas包的安装和Could not find a version that satisfies|9
pandas包的安装和Could not find a version that satisfies|9
1171 8