看板 Python 關於我們 聯絡資訊
由於目前還在測試怎麼包 所以先做比較簡單的範例 以下為程式碼 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://www.ptt.cc/bbs/Python/M.1411657183.A.C40.html
Thisisnotptt: 我之前也遇到這個問題,換CX_freeze就會動了 10/01 16:42
Thisisnotptt: 我用的是GUI2EXE 10/01 16:43
wsqa: 感謝!!我來試試看~~~ 10/01 23:01
Thisisnotptt: 坦白講 一堆人在問這個問題,也很多教學文,但我都 10/02 01:57
Thisisnotptt: 有看沒懂,所以直接選比較懶人的方法做 10/02 01:58
Thisisnotptt: 抓完GUI2EXE之後安裝CX_Freexe再點開CUI2EXE設定CX 10/02 02:01
Thisisnotptt: 的路徑,以後應該就可以無腦打包了 10/02 02:01