使用cx_Freeze,PyQt4,matplotlib和多个.py文件创建exe文件不起作用

时间:2016-06-09 07:59:34

标签: python python-3.x matplotlib pyqt4 cx-freeze

我目前正在使用cx_Freeze将我的python项目构建到exe文件中,并且我不确定我做错了什么,因为我使用了Anthony Tuininga的示例(PyQt4和matplotlib)({{3这样做。

我有三个.py文件,一个主文件,一个ui文件和一个函数文件。 当然还有setup.py文件。

我只在我的文件中导入这些包:

from PyQt4 import QtCore, QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure

我使用64位的Python 3.4.3(来自mini conda) matplotlib 1.5.1,cx_Freeze 4.3.4 64位和Windows 10 64位

我的setup.py文件如下所示:

from cx_Freeze import setup, Executable
buildOptions = dict(packages=["atexit"],
#I also tried this one: #packages=["PyQt4.QtGui","PyQt4.QtCore","matplotlib"], 
#and instead of matplotlib, I also tried this one #"matplotlib.backends.backend_qt4agg"
                    excludes=["Tkinter"],
                    include_files=["Factory.ico","Main_Functions.py","Main_Ui.py"])
base = 'Win32GUI'
executables = [
    Executable('Main.py', base=base,icon="Factory.ico",compress = True)
]

setup(name="Simulator",
      version="0.0.1",
      description="NA",
      author="NA",
      author_email="NA",
      options=dict(build_exe=buildOptions),
      executables=executables)

构建过程没有任何错误(至少我没有找到任何错误)但是一旦我想启动应用程序,我收到以下错误消息,我不理解为目录C :\ Python不存在。 我也看到其他人有同样的问题,但他们的解决方案对我没有用,或者我做错了。

请你帮我解决这个问题,因为我不知道该做什么,而且我有点沮丧:( 非常感谢你提前:) https://github.com/GreatFruitOmsk/cx_freeze/tree/finder_zip_pkgs/cx_Freeze/samples

0 个答案:

没有答案