栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Could not find a version that satisfies the requirement库 和 WARNING: You are using pip version需要更新的解法

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Could not find a version that satisfies the requirement库 和 WARNING: You are using pip version需要更新的解法

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

问题1:pip install 无法导入指定存在版本库
问题描述

新安装好虚拟环境后,

(tensorflow) C:UsersDawnight>pip install pandas==1.4.2
ERROR: Could not find a version that satisfies the requirement pandas==1.4.2 (from versions: 0.1, 0.2, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.0, 0.6.1, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.16.1, 0.16.2, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 0.19.2, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4, 0.24.0, 0.24.1, 0.24.2, 0.25.0, 0.25.1, 0.25.2, 0.25.3)
ERROR: No matching distribution found for pandas==1.4.2

怀疑是用的国外的网址网速问题,更换了国内镜像,但依然报错

ERROR: Could not find a version that satisfies the requirement pandas==1.4.2 (from versions: none)
ERROR: No matching distribution found for pandas==1.4.2
原因分析

通过看大佬的帖子,意识到可能是该虚拟环境中既有python2.x环境,又有python3.x环境,但用pip指令,虚拟环境无法识别我用的是哪个虚拟环境需要手动指定。

解决方法

指定在python3.x环境下如下下载库:py -3 -m pip install 需要添加的库 ,成功

问题2:WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
问题描述

新问题,出现了黄色警告看着难受

WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
You should consider upgrading via the 'C:UsersDawnightAppDataLocalProgramsPythonPython39python.exe -m pip install --upgrade pip' command.
原因分析

pip本版需要更新,但是直接依照提示的 pip install --upgrade pip 我的并没有成功。

解决方式

依然是上题的思路:py -3 -m pip install --upgrade pip 更新pip版本成功,pip消除。

小结

我反思了一下尝试安装多个虚拟环境,终于找到了有些一次性成功,有些虚拟环境问题层出不穷的根源:创建虚拟环境时偷懒了,没有规定python的版本号!

conda create --name newEnv python=x.x #创建新环境,其中-name可替换为-n ;
# 如果不写python版本号就和主anaconda的python版本相同,一定要规定!!!


最后,还有一个小问题:我设定版本为python==3.6时,

conda create --name newEnv python=3.6 #创建环境
conda install jupyter #安装jupyter包
#jupyter notebook 存在闪退现象
#在虚拟环境中用命令行的方式打开
#报错提示:AttributeError: type object 'IOLoop' has no attribute 'initialized'
#解决方法:
conda install tornado=4.5 #python环境版本问题,降低tornadi版本
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/968299.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号