我正在使用cx_Freeze将我在python中的脚本转换为可执行文件,在我的笔记本电脑(32位Windows 7)上安装后它可以正常工作。复制.msi文件并将其安装在我朋友的笔记本电脑(64位Windows 10)上后,会显示此错误。
我认为错误是我的脚本中使用'win32com.client'的。 如何让我的系统在其他平台上运行?我是新手,所以我希望任何人都能帮助我。
编辑:
这是我的setup.py脚本。
from cx_Freeze import setup, Executable
import sys
import os
os.environ['TCL_LIBRARY'] = r'C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\Admin\AppData\Local\Programs\Python\Python35-32\tcl\tk8.6'
base = None
if sys.platform == 'win32':
base = "Win32GUI"
if sys.platform == 'win64':
base = "Win64GUI"
executables = [Executable("nafd.py", base=base,shortcutName="Nafd Encoding System",shortcutDir="ProgramMenuFolder", icon = "ntc96.ico")]
setup(
name = "Nafd32",
options = {"build_exe":{"packages": ["time","win32com.client","tkinter","openpyxl","functools","os","datetime","re","requests","io","math"],"include_files":["newlistofcity.txt","newlistofbrgy.txt","newlistofbrgycode.txt","ntc96.ico","tcl86t.dll", "tk86t.dll"]}},
version = "2.1.5",
description = "Network and Facilities Division Encoding System",
executables = executables
)
答案 0 :(得分:0)
通过在我的.dll
中包含pyinstaller创建的dist文件夹中的所有setup.py
来解决问题。我不知道为什么cx_Freeze没有从.dll
复制win32com.client
文件,但是pyinstaller复制了所有这些文件。