Pyinstaller打包运行exe报错 No module named matplotlib.backends.backend_tkagg
来源:互联网 发布:淘宝发短信给客户 编辑:程序博客网 时间:2024/06/08 09:31
原文链接
up vote7down vote
I've seen this before, also on openSUSE (12.3). The fix is to edit the default matplotlibrc file.
Here's how you find where the default matplotlibrc file lives, and where it lives on my machine:
>>> import matplotlib>>> matplotlib.matplotlib_fname()'/usr/lib64/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc'
The backend setting is the first configuration option in this file. Change it from TkAgg
to Agg
, or to some other backend you have installed on your system. The comments in the matplotlibrc file list all backends supported by matplotlib.
The backend specified in this file is only the default; you can still change it at runtime by adding the following two lines, before any other matplotlib import:
import matplotlibmatplotlib.use("Agg") # or whichever backend you wish to use
1
Good answer. Official matplotlib config example: matplotlib.org/users/customizing.html – Plamen Jun 29 '14 at 16:11
This didn't work for me. However, I was able to fix the error by importing the backend module before importing matplotlib.pyplot. See my answer. I expect there is a better solution than mine that involves specifying the path to the backend modules. – user3731622 Aug 19 '15 at 23:10
也可参考 http://www.cnblogs.com/nima/p/4996058.html
阅读全文
0 0
- Pyinstaller打包运行exe报错 No module named matplotlib.backends.backend_tkagg
- paramiko安装报错ImportError: No module named cryptography.hazmat.backends
- 解决pyinstaller打包时出现的“ No module named pkg_resources”
- pyinstaller 打包时出现No Module Named pkg_resources
- pyinstaller 遇到no module named ""
- Python运行scrapy报错:ImportError: No module named win32api
- 运行yum报错:No module named yum
- ROS运行python脚本报错: No module named srv
- 运行dcgan_code报错,提示ImportError: No module named numpy_pickle
- pycharm运行tkinter报错ImportError: No module named tkinter
- ImportError: No module named matplotlib
- No module named matplotlib.pyplot
- Pyinstaller : ImportError: No module named pefile
- Pyinstaller Python ImportError: No module named publisher
- python打包exe文件-ImportError: No module named 'queue'
- 报错:ImportError: No module named 'requests'
- django报错:No module named urls
- ImportError: No module named setuptools 报错
- 排序指标NDCG
- C/C++中算法运行时间的三种计算方…
- while(true)循环与CPU占用率问题
- androidstudio ndk 配置
- zlib学习总结
- Pyinstaller打包运行exe报错 No module named matplotlib.backends.backend_tkagg
- 2014年07月01日
- 无法找到“XXX.exe”的调试信息,或…
- SQL关联查询图解
- 坐班族轻敲胆经防便秘
- linux 中的软件安装位置(转载)
- [深度学习]RCNNs系列(3)Fast RCNN介绍
- Linux C 编译错误 “un
- 安装arm-linux-gcc环境变量…