【发布时间】:2017-10-14 03:26:15
【问题描述】:
我是法国人,所以对我的英语感到抱歉。 我实际上创建了一个使用 tkinter、paramiko、telnetlib 和许多其他的 Python 3.6.1 程序,并且我想用 cx_Freeze 创建一个 exe。使用“Hello World”程序可以成功,但是当我尝试仅使用 Tkinter 时,它不起作用。我有一个错误屏幕,因为我在运行 exe 时在终端上看不到超过 0.5 秒。所以我用我的 setup.py 加入了那个屏幕。
setup.py:
import cx_Freeze
import os
os.environ['TCL_LIBRARY'] = r'C:\LOCAL_TO_PYTHON\Python35-32\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\LOCAL_TO_PYTHON\Python35-32\tcl\tk8.6'
executables= [cx_Freeze.Executable('exeTest.py',)]
cx_Freeze.setup(
name = "leTest",
options = {'built.exe':{'includes': ['tkinter','paramiko','telnetlib']}},
version = "1.0",
description = "Bonjour !",
executables = executables,
)
错误:
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\cx_Freeze\initscripts\__startup.py", in line 12, in <module>
__import__(name+"__init__")
File "C:\Python36\lib\site-packages\cx_Freeze\initscripts\Console.py", in line 24, in <module>
exec(code, m.__dict__)
File "exeTest.py", line 9, in <module>
File "C:\Python36\lib\tkinter\__init.py", in line 36, in <module>
import _tkinter # If this fails your Python may not be configured fot Tk
ImportError: DLL load failed: The specified module can not be found.
感谢您的阅读,也许是您的帮助
【问题讨论】:
-
这实际上不是完整的回溯,因此很难诊断,有什么方法可以获得完整的回溯?初步来看,此错误表明您正在尝试导入某些内容但失败了。
-
我无法发送我的截图 :(
-
无论如何,您都应该输入屏幕截图中的内容。如果错误出现在图像中并且以后无法搜索,则对遇到相同问题的任何人都没有帮助。
-
所有的traceback我都写好了