首页 > 解决方案 > Pyinstaller:在以下目录中找不到可用的 init.tcl 这可能意味着 tcl 没有正确安装

问题描述

我正在做我的 tkinter 项目。当我尝试使用 pyinstaller 编译它时,我得到了图片中显示的错误。在重置我的电脑之前没有发生这种情况:

错误图像

我试图编译的代码:

import tkinter as tk
from tkinter import filedialog, Text, DISABLED, NORMAL, ttk
from PIL import ImageTk, Image
import pyglet,tkinter
pyglet.font.add_file('font.ttf')
arkaplan = "#000000"
koyugri = "#1c1c1c"

root = tk.Tk()
root.title(f"AcemTube Başlatılıyor...")
root.resizable(False, False)
yer = str(root.winfo_screenwidth()/2 - 350/2).split(".")[0]
yer1 = str(root.winfo_screenheight()/2 - 90/2).split(".")[0]
root.geometry(f"350x90+{yer}+{yer1}")
root.overrideredirect(1)
canvas = tk.Canvas(root, height=90, width=350, background="#23272a")
canvas.pack()
#baslikutu = tk.Frame(root, bg="#2082b2")
#baslikutu.place(relwidth=1, relheight=0.1)

baslikutu1 = tk.Frame(root, bg=arkaplan)
baslikutu1.place(relwidth=1, relheight=1)
baslik = tk.Label(baslikutu1, text=f"AcemTube", bg=arkaplan, fg="white")
baslik.config(font=("Montserrat ExtraBold", "28", "bold italic"))
baslik.place(relwidth=0.65, relheight=0.75, relx=0.299)
frm= tk.Frame()
logo = ImageTk.PhotoImage(Image.open("acemtubes.png"))
rlbl = tk.Label(baslikutu1, image=logo, bg=arkaplan ,fg="#23272a")
rlbl.place(relwidth=0.31, relheight=0.78)
s = ttk.Style()
s.theme_use("clam")
s.configure("red.Horizontal.TProgressbar", foreground='#23272a', background='#2082b2', troughcolor=koyugri, bordercolor="#2082b2", darkcolor="#2082b2", lightcolor="#2082b2")
prgs = ttk.Progressbar(baslikutu1, style="red.Horizontal.TProgressbar", orient=tk.HORIZONTAL,    length=350, mode="determinate")
prgs.place(rely=0.791)
prgs.start(24)

root.mainloop()`

谢谢阅读。我是菜鸟,所以请解释一下如何解决这个问题。谢谢 :)

编辑:我忘了说 init.tcl 存在于这个文件夹中。Tcl 文件夹的图像

标签: pythonpython-3.xtkintertclpyinstaller

解决方案


推荐阅读