我正在尝试使用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文件夹具有转换为python的c模块的.py和.pyd文件。
这是我第一次尝试为python脚本创建可执行文件,请原谅任何初学者错误。
感谢你的帮助。