【问题标题】:Convert python to exe using py2exe使用py2exe将python转换为exe
【发布时间】:2013-11-24 17:09:42
【问题描述】:

我的目标是将 py 文件转换为 exe 文件。

我有一个使用以下库的 python 文件:

import matplotlib
matplotlib.use('TkAgg')
import numpy as np 
import scipy import signal
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import Tkinter as Tk 
import tkFileDialog

我使用的设置文件:

from distutils.core import setup
import py2exe
setup(
      console =['name of my python file'],
)

我已经按照 youtube 上的教程成功创建了一个 exe 文件。 但是当我运行它时,我得到了以下反馈。

Could not find the matplotlib data files.

您能告诉我发生了什么并为我提供解决方案吗? 非常感谢你。

【问题讨论】:

  • 你检查matplotlib是否可以打包成exe文件?有一些模块不能通过 p2exe 放入 exe 文件中。
  • 我不记得另一个问题的确切位置,但我很确定这是重复的。你可能想调查一下。

标签: python matplotlib py2exe


【解决方案1】:

py2exe 网站上有关于如何使用 matplotlib 的教程。 http://www.py2exe.org/index.cgi/MatPlotLib

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-07
    • 1970-01-01
    • 2019-06-04
    • 2023-04-06
    • 1970-01-01
    相关资源
    最近更新 更多