Python Py2Exe TkInter:DLL加载失败
我使用py2exe创建并编译我的Python 3.4脚本。它在我编译它的PC(Windows 10 64位)上运行良好,但是当我尝试在另一台未安装Python的PC(Windows 7 64位)上运行它时,日志中出现以下错误:Python Py2Exe TkInter:DLL加载失败,python,python-3.x,tkinter,py2exe,Python,Python 3.x,Tkinter,Py2exe,我使用py2exe创建并编译我的Python 3.4脚本。它在我编译它的PC(Windows 10 64位)上运行良好,但是当我尝试在另一台未安装Python的PC(Windows 7 64位)上运行它时,日志中出现以下错误: Traceback (most recent call last): File "PCSpeedDiagnostics.pyw", line 12, in <module> File "C:\Python34\lib\tkinter\__init__.
Traceback (most recent call last):
File "PCSpeedDiagnostics.pyw", line 12, in <module>
File "C:\Python34\lib\tkinter\__init__.py", line 36, in <module>
File "C:\Python34\lib\tkinter\_fix.py", line 65, in <module>
File "<loader>", line 10, in <module>
File "<loader>", line 8, in __load
ImportError: (DLL load failed: The specified module could not be found.) 'C:\\Users\\[MY NAME]\\Downloads\\dist\\_tkinter.pyd'
有人知道我做错了什么吗?多亏了,我现在有了答案
这是我的新setup.py文件:
from distutils.core import setup
import py2exe, tkinter
setup(windows=['PCSpeedDiagnostics.pyw'],
name="PC Speed Diagnostics Tool",
data_files = [('', ['banner.png', 'blank.png', 'dialog_apply.png',
'gnome_application_x_executable.png', 'gnome_dialog_error.png',
'gnome_document_send.png', 'gnome_document_send_error.png',
'gnome_network_offline.png', 'gnome_network_transmit_receive.png',
'gnome_network_wireless.png', 'gnome_system_run.png',
'iperf3.exe'])],
options = {
'py2exe': {
'bundle_files': 3,
'optimize': 2,
'includes': ['tkinter'],
}
},
)
from distutils.core import setup
import py2exe, tkinter
setup(windows=['PCSpeedDiagnostics.pyw'],
name="PC Speed Diagnostics Tool",
data_files = [('', ['banner.png', 'blank.png', 'dialog_apply.png',
'gnome_application_x_executable.png', 'gnome_dialog_error.png',
'gnome_document_send.png', 'gnome_document_send_error.png',
'gnome_network_offline.png', 'gnome_network_transmit_receive.png',
'gnome_network_wireless.png', 'gnome_system_run.png',
'tcl86.dll', 'tk86.dll', 'iperf3.exe'])],
options = {
'py2exe': {
'bundle_files': 3,
'optimize': 1,
'includes': ['tkinter'],
'dll_excludes': ['tcl86.dll', 'tk86.dll'],
}
},
)
我已经将tcl86.dll和tk86.dll复制到与exe相同的目录中