作者wsqa (工作要顺利``)
看板Python
标题[问题] py2exe使用後有ERROR
时间Thu Sep 25 22:59:41 2014
由於目前还在测试怎麽包
所以先做比较简单的范例
以下为程式码
import matplotlib
from pylab import *
aaa=1
print aaa
但执行完py2exe後(执行成功)
执行我的exe却跑出
Traceback (most recent call last):
File "test.py", line 1, in <module>
File "matplotlib\__init__.pyc", line 947, in <module>
File "matplotlib\__init__.pyc", line 856, in rc_params
File "matplotlib\__init__.pyc", line 743, in matplotlib_fname
File "matplotlib\__init__.pyc", line 312, in wrapper
File "matplotlib\__init__.pyc", line 655, in _get_data_path_cached
File "matplotlib\__init__.pyc", line 651, in _get_data_path
RuntimeError: Could not find the matplotlib data files
我觉得问题应该出在我的setup.py没有包到matplotlib
以下为我的setup.py
from distutils.core import setup
import py2exe
setup(windows=['test.py'])
只是单纯用tutorial上的写法
因为我看别人的范例看不懂要怎麽加
可否请教前辈指点一下要怎麽把matplotlib加进去
或是要怎麽解决我目前的error呢
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 115.43.190.130
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Python/M.1411657183.A.C40.html
1F:推 Thisisnotptt: 我之前也遇到这个问题,换CX_freeze就会动了 10/01 16:42
2F:→ Thisisnotptt: 我用的是GUI2EXE 10/01 16:43
3F:→ wsqa: 感谢!!我来试试看~~~ 10/01 23:01
4F:推 Thisisnotptt: 坦白讲 一堆人在问这个问题,也很多教学文,但我都 10/02 01:57
5F:→ Thisisnotptt: 有看没懂,所以直接选比较懒人的方法做 10/02 01:58
6F:推 Thisisnotptt: 抓完GUI2EXE之後安装CX_Freexe再点开CUI2EXE设定CX 10/02 02:01
7F:→ Thisisnotptt: 的路径,以後应该就可以无脑打包了 10/02 02:01