我正在尝试使用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调用的另外2个python文件。 Dependencies文件夹具有从c模块转换为python的.py和.pyd文件。
这是我第一次尝试为python脚本创建可执行文件,请原谅任何错误。
非常感谢您的帮助!