我在CentOS6上使用cx_freeze(通过Bash),当我执行“Python setup.py build”时,我收到此错误:
$ python setup.py build
File "setup.py", line 11
options=['build_exe':{'excludes':excludes, 'packages':packages, 'include_files':includefiles}]
^
SyntaxError: invalid syntax
这是我的setup.py:
import sys
from cx_Freeze import setup, Executable
includefiles = ['cpu.py']
includes = ['psutil', 'time', 'socket']
excludes=[]
packages=[]
setup(name='CPU Stats',
version='0.1',
description='Script to pull CPU Stats',
options=['build_exe':{'excludes':excludes, 'packages':packages, 'include_files':includefiles}]
executables=[Executable('cpu.py')]
)
'Cpu.py'是我要捆绑的脚本。“psutil”,“time”,“socket”是Python模块。
对于我的setup.py,我使用了@Slobodan Stevic的[this] cx_Freeze and Python 3.3
答案 0 :(得分:1)