【发布时间】:2013-09-04 14:02:19
【问题描述】:
OI 在 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
【问题讨论】: