我正在尝试使用Python 3.6制作可执行程序,而我找到的唯一能做到这一点的软件是cx_Freeze。然而,每次在CMD中运行“python setup.py build”时,当我尝试打开我的应用程序时,都会出现错误。
当我尝试冻结可执行文件时,出现了缺少所需依赖项的错误,导入错误:缺少必需的依赖项['numpy']。
这是我的setup.py文件:
当我尝试冻结可执行文件时,出现了缺少所需依赖项的错误,导入错误:缺少必需的依赖项['numpy']。
这是我的setup.py文件:
import cx_Freeze
from cx_Freeze import setup
from cx_Freeze import Executable
import sys
import matplotlib
import pandas
import os
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')
base = None
if sys.platform == 'win32':
base = "Win32GUI"
executables = [cx_Freeze.Executable("EXE.py",icon = 'RomacLogo.ico', base=base)]
build_exe_options = {"packages": ["numpy"]}
cx_Freeze.setup(
name = "DAGM",
options = {"build.exe":{"packages":["tkinter", "matplotlib",'numpy', "numpy.lib.format", "pandas", "glob"], "include_files":["RomacLogo.ico"]}},
version = "0.01",
description = "Data Transfer and Analysis Application",
executables = executables
)
除了cx_freeze,还有其他可用于制作可执行文件的冻结程序吗?
非常感谢您的任何帮助!