解决AttributeError: ‘NoneType’ object has no attribute 'loader’报错问题

ps:作者是很用心写的,如果觉得不错,请给作者一点鼓励噢!(点赞收藏评论噢)

问题描述

1)在Anoconda Prompt窗口torch环境下无论运行什么命令,都出现AttributeError: ‘NoneType’ object has no attribute 'loader’报错,命令运行失败
在这里插入图片描述
2)打开torch环境下的jupyter编辑器也会出现相应报错在这里插入图片描述

原因分析

1)输入指令查看安装了哪些Python库

python -m pip list

结果:发现当前torch环境下并没有安装matplotlib库,回到base环境,发现问题出在base环境下的matplotlib库

解决过程

base环境下重新安装matplotlib库

pip uninstall matplotlib
pip install matplotlib

在这里插入图片描述
安装成功!

结果查看

在这里插入图片描述
现在torch环境下属于命令行就不会报错啦!!

Logo

GitCode AI社区是一款由 GitCode 团队打造的智能助手,AI大模型社区、提供国内外头部大模型及数据集服务。

更多推荐