OI 在 CentOS6 上(通过 Bash)使用 cx_freeze,当我执行“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 和 Python 3.3