0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pyinstallerでexe化したファイルを実行するとPCが落ちてしまいます

Posted at

下記のコードをjupyternotebookで実行し、exeファイルは作成できましたが、実行するとPCが強制的にログアウト画面に戻ってしまいます。(mac使用)
exeファイルのサイズは8.2MBです。

Tkinter.ipynb
--add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl'

上記をなくすと落ちなくなりますが、「tcl data directory not found」というエラーになります。

どなたか詳しい方がいらっしゃいましたら、解決策をお教えいただけないでしょうか?

Tkinter.ipynb

import tkinter as tk

class Application(tk.Frame):
    def __init__(self, master):
        super().__init__(master)
        self.pack()
        
        master.geometry("500x200")
        master.title("テストソフト")
        
        self.setGUI()
        
    def setGUI(self):
        self.txt1 = tk.Entry(width=50)
        self.txt1.place(x=15, y=50)
        
        self.txt2 = tk.Entry(width=50)
        self.txt2.place(x=15, y=100)
        
        self.btn = tk.Button(text="実行", command = self.btn_click, width=30)
        self.btn.place(x=125, y=150)
        
    def btn_click(self):
        if self.txt1.get() == "":
            self.txt2.delete(0, tk.END)
            self.txt2.insert(0, "")
        else:
            self.txt2.delete(0, tk.END)
            self.txt2.insert(0, self.txt1.get())
            
if __name__ == "__main__":
    win = tk.Tk()
    app = Application(master = win)
    app.mainloop()


pyinstaller --onefile  --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' Tkinter.ipynb
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?