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

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

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


问题描述

新安装好虚拟环境后,

(tensorflow) C:\Users\Dawnight>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:\Users\Dawnight\AppData\Local\Programs\Python\Python39\python.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版本
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值