Cx Freeze Python Build

时间:2017-04-04 19:25:47

标签: python cx-freeze

我正在尝试使用Cx_Freeze构建一个python文件。这是我的设置文件,我在下面得到错误。我根据此处提供的信息修改了setup.py文件:

Cx_freeze ImportError no module named scipy

我还修改了cx_freeze文件夹中的host.py,如同一个链接

中所述
import cx_Freeze
import sys
import os
import wx
import glob
import matplotlib.pyplot as plt
import matplotlib.image as image
import numpy as np
from scipy.fftpack import fft, ifft
import xlsxwriter
from scipy.signal import argrelextrema


base = None

if sys.platform == 'win32':
    base = "Win32GUI"

executables = [cx_Freeze.Executable("main.py", base = base)]
cx_Freeze.setup(
    name = "blabla",
    options = {"build_exe": {"packages":["wx","xlsxwriter","matplotlib","numpy","scipy","glob"] ,
                             "include_files":['C:\Python27\Lib\site-packages\scipy']
                             }},


    version = "1.0",
    description = "blabla",
    executables = executables

)

Traceback (most recent call last):
  File "setup.py", line 42, in <module>
    executables = executables
  File "C:\Python27\lib\site-packages\cx_Freeze\dist.py", line 362, in setup
    distutils.core.setup(**attrs)
  File "C:\Python27\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\cx_Freeze\dist.py", line 232, in run
    freezer.Freeze()
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 626, in Freeze

    self.compress, self.copyDependentFiles)
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 526, in _Write
Modules
    module.Create(finder)
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 762, in Create

    module.file, module.name)
cx_Freeze.freezer.ConfigError: no file named sys (for module collections.sys)

0 个答案:

没有答案