【发布时间】:2011-04-29 14:50:47
【问题描述】:
当我尝试导入 matplotlib.pyplot 时出现以下错误:
RuntimeError("'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored "% (h, h))
我的主目录中确实有一个 .matplotlib 目录,该目录归我所有并具有写入权限。那么为什么它告诉我它是“不可写的目录”,我该如何解决这个问题?
【问题讨论】:
-
异常的最终输出是什么?即类似
RuntimeError: '/home/ranjit' is not a writable dir; you must set /home/ranjit/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored -
是的,%s 是我的主目录。所以它绝对是可写的。
-
ls -ld ~/.matplotlib的输出是什么 -
好的,问题解决了。其实这很愚蠢。磁盘已满,这就是为什么它报告我的主目录不可写。
-
搞笑,我也遇到了同样的问题...解决方案:下载数据集时要小心
标签: python matplotlib