python - cx_Freeze 在 64 位 os 上显示错误
python - cx_Freeze shows error on a 64-bit os
我正在将 python 中的脚本转换为使用 cx_Freeze 的可执行文件,在我的笔记本电脑(32 位 windows 7)上安装它后它工作正常。复制 .msi 文件并将其安装到我朋友的笔记本电脑(64 位 windows 10)后,它显示此错误。
我认为错误出在我使用 'win32com.client' 的脚本部分。
如何让我的系统在其他平台上运行?我对这种东西很陌生,所以我希望任何人都能帮助我。
Error message
已编辑:
这是我的 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
)
通过将 pyinstaller 创建的 dist 文件夹中的所有 .dll
包含在我的 setup.py
中解决了这个问题。我不知道为什么 cx_Freeze 没有从 win32com.client
复制 .dll
文件,但 pyinstaller 复制了所有这些文件。
我正在将 python 中的脚本转换为使用 cx_Freeze 的可执行文件,在我的笔记本电脑(32 位 windows 7)上安装它后它工作正常。复制 .msi 文件并将其安装到我朋友的笔记本电脑(64 位 windows 10)后,它显示此错误。
我认为错误出在我使用 'win32com.client' 的脚本部分。 如何让我的系统在其他平台上运行?我对这种东西很陌生,所以我希望任何人都能帮助我。
Error message
已编辑:
这是我的 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
)
通过将 pyinstaller 创建的 dist 文件夹中的所有 .dll
包含在我的 setup.py
中解决了这个问题。我不知道为什么 cx_Freeze 没有从 win32com.client
复制 .dll
文件,但 pyinstaller 复制了所有这些文件。