import matplotlib.pyplot as plt出错

本文详细介绍了在使用Matplotlib模块时遇到的字体缓存问题及解决方案。当Matplotlib在构建字体缓存时可能会出现警告,通过删除特定缓存文件可以避免这一问题。文章还分享了一个案例,在尝试删除缓存前,重新导入Matplotlib模块时,问题已自行解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

>>>import matplotlib.pyplot as plt
/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

在第八讲中,导入这个模块出错
解决:

找到缓存目录 删除~/.cache/matplotlib下面的缓存

 deleted ~/.cache/matplotlib/fontList.cache

但是,当我准备删的时候,再import matplotlib时时没有出错,不知道具体的原因是什么

转载于:https://www.cnblogs.com/fcfc940503/p/11101142.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值