【发布时间】:2016-10-08 11:56:20
【问题描述】:
我已经安装了 cx_freeze,它的工作原理就像构建 .exe 的魅力,但我想使用 windows 7 为 mac os x 制作我的 python 程序的可执行文件。你能指导我如何使用 cx_freeze 或任何其他方法来完成它应用。
我使用以下代码构建.exe
from cx_Freeze import setup, Executable
build_exe_options = {
"packages": [],
'includes': ['lxml.etree', 'lxml._elementpath', 'gzip'],
'excludes' : ['boto.compat.sys',
'boto.compat._sre',
'boto.compat._json',
'boto.compat._locale',
'boto.compat._struct',
'collections.abc',
'boto.compat.array'],
"include_files": []}
setup(
name = "xyz",
version = "0.1",
description = "",
author = "Dengar",
options = {"build_exe": build_exe_options},
executables = [Executable("xyz.py")]
)
【问题讨论】:
-
你需要 Mac OS X。尝试在 windows 7 上安装虚拟机,安装 OS X。然后你可以为这个目标操作系统构建。
标签: python windows macos cx-freeze