运行python setup.py build
会在几秒钟后无错误结束,并且不会创建任何内容,目录中也没有构建文件夹。我也尝试过python setup.py build_exe
和python setup.py bdist_msi
,但都没有用。
我的setup.py看起来像这样:
import os
import sys
import os.path
from cx_Freeze import setup, Executable
import cx_Freeze.hooks
def hack(finder, module):
return
cx_Freeze.hooks.load_matplotlib = hack
import scipy
import matplotlib
from pyface.qt import QtGui, QtCore
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
exclude_list = [...]
packages = [...]
target = Executable(
script="main.py",
targetName="name.exe",
icon="icon.ico",
base="Win32GUI",
)
include_files = [...]
setup(name='name',
version='1.0',
author='author',
options = {"build_exe": { 'excludes': exclude_list,
'packages': packages,
'include_msvcr': True,
'include_files': include_files,
}
},
executables = [target],
)
任何人都知道可能出了什么问题?预先感谢!