【发布时间】:2019-01-02 16:55:25
【问题描述】:
我正在尝试使用 cx_Freeze 为我的程序制作可执行文件。 尽管 python 程序运行良好,但可执行文件说它无法归档 file_cleaner。
这就是 setup.py 的样子
import sys
from cx_Freeze import setup, Executable
import os.path
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')
build_exe_options = {"packages": ["os", "glob", "itertools", "numpy",
"matplotlib", "lmfit", "pandas", "scipy", "pathlib"], "includes": [
"src\\BCS_fit.py", "src\\file_cleaner.py", "src\\__init__.py",
"src\\dependencies\\"], "include_files": ["test\\"]}
base = None
setup(name="BCS processor",
version="0.1",
description="Console application for processing VTS data and fitting it
according to BCS theory",
author="Anil Radhakrishnan",
options={"build_exe": build_exe_options},
executables=[Executable("src\\Master.py", base=base)])
BCS_fit.py 和 file_cleaner.py 是我从 master.py 调用的另外两个 python 文件。 Dependencies 文件夹包含从 c 模块转换为 python 的 .py 和 .pyd 文件。
这是我第一次尝试为 python 脚本创建可执行文件,请原谅任何初学者错误。
非常感谢您的帮助!
【问题讨论】:
标签: python build exe executable cx-freeze