当我在py文件中导入matplotlib.pyplot后,在linux shell 运行py文件时,出现Segmentation fault (core dumped)错误提示,谷歌之后,找到了解决的方法:
import matplotlib as mpl
mpl.use('TkAgg') # or whatever other backend that you want
import matplotlib.pyplot as plt
链接:原问题链接
本文介绍了一种在Linux环境下,使用matplotlib时遇到Segmentation fault(coredumped)错误的解决方案。通过调整matplotlib的后端设置,可以有效避免这一问题,确保代码在Linux shell中顺利运行。
当我在py文件中导入matplotlib.pyplot后,在linux shell 运行py文件时,出现Segmentation fault (core dumped)错误提示,谷歌之后,找到了解决的方法:
import matplotlib as mpl
mpl.use('TkAgg') # or whatever other backend that you want
import matplotlib.pyplot as plt
链接:原问题链接
739
1203
3330
7881

被折叠的 条评论
为什么被折叠?