使用cx_Freeze和Tkinter时,我收到消息:
File "C:\Users\VergilTheHuragok\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 35, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: DLL load failed: The specified module could not be found.
Run Code Online (Sandbox Code Playgroud)
有些事情需要注意:
这是我目前的setup.py:
from cx_Freeze import setup, Executable
import sys
build_exe_options = {"packages": ["files", "tools"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(name="Name",
version="1.0",
description="Description",
options={"build_exe": build_exe_options},
executables=[Executable("main.py", base=base)],
package_dir={'': ''},
)
Run Code Online (Sandbox Code Playgroud)
我从互联网的各个角落尝试了很多解决方案.包括但不仅限于: