1
我尝试使用cx_freeze我Tkinter的文件转换为EXE,但我得到这个错误所有的时间 the error转换Tkinter的PY文件转换成EXE文件
翻译希伯来部分:模块didnt发现
我安装文件的代码是:
import sys
from cx_Freeze import setup, Executable
import os
os.environ['TCL_LIBRARY'] = "C:\\Users\\royreznik\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\\royreznik\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6"
build_exe_options = {"includes": ["tkinter"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "simple_Tkinter",
version = "0.1",
description = "Sample cx_Freeze Tkinter script",
options = {"build_exe": build_exe_options},
executables = [Executable("tal1.py", base = base)])
和我的主要文件是:
from tkinter import *
root = Tk()
Entry1 = Entry(root)
Entry2 = Entry(root)
Entry1.grid(row=0)
Entry2.grid(row=1)
Label1 = Label(root, text="null")
Label1.grid(row=4)
def funca():
phrase = Entry1.get()
words = phrase.split()
wordCount = 0;
for word in words:
if word == Entry2.get():
wordCount = wordCount+1
Label1.configure(text=wordCount)
btn = Button(root, text="get Num",command=funca)
btn.grid(row=3)
root.mainloop()
最新的问题是什么?
我建议你使用'py2exe'库 – CunivL