构建时出现cx-freeze错误 [英] cx-freeze error on build
本文介绍了构建时出现cx-freeze错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在Win 7 64位上进行构建时,我不断收到此错误:
I keep getting this error when trying to do a build on Win 7 64bit:
C:\Users\Tom>python C:\Users\Tom\Documents\setup.py build
running build
running build_exe
copying C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\bases\Win32GUI.exe ->
build\exe.win32-2.7\NJM_GUI.exe
copying C:\Users\Tom\Anaconda\python27.dll -> build\exe.win32-2.7\python27.dll
Stamped: build\exe.win32-2.7\NJM_GUI.exe
Traceback (most recent call last):
File "C:\Users\Tom\Documents\setup.py", line 29, in <module>
executables=executables
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\dist.py", line 362, in
setup
distutils.core.setup(**attrs)
File "C:\Users\Tom\Anaconda\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Users\Tom\Anaconda\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Users\Tom\Anaconda\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Tom\Anaconda\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Users\Tom\Anaconda\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\Tom\Anaconda\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\dist.py", line 232, in
run
freezer.Freeze()
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\freezer.py", line 610,
in Freeze
self.compress, self.copyDependentFiles)
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\freezer.py", line 510,
in _WriteModules
module.Create(finder)
File "C:\Users\Tom\Anaconda\lib\site-packages\cx_Freeze\freezer.py", line 746,
in Create
module.file, module.name)
cx_Freeze.freezer.ConfigError: no file named sys (for module boto.compat.sys)
我的setup.py文件如下:
my setup.py file looks like:
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
options = {
'build_exe': {
'includes': 'atexit'
}
}
executables = [
Executable('C:\Users\Tom\Documents\NJM_GUI.py', base=base)
]
setup(name='simple_PyQt4',
version='0.1',
description='Sample cx_Freeze PyQt4 script',
options=options,
executables=executables
)
我确实在我的应用程序和pyqt中都使用了numpy和pandas,但是不确定问题出在哪里还是如何解决?
I do use numpy and pandas in my app as well as pyqt but not sure what the issue is here or how to resolve it?
谢谢。 / p>
Thanks.
推荐答案
完整的详细答案位于 cx_freeze无法使用熊猫库创建exe 。
The full detailed answer is at cx_freeze fails to create exe with pandas library.
简短版本不包括以下文件:
The short version is exclude the following files:
'build_exe': {
'excludes': ['boto.compat.sys',
'boto.compat._sre',
'boto.compat._json',
'boto.compat._locale',
'boto.compat._struct',
'boto.compat.array'],
}
这篇关于构建时出现cx-freeze错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文