[PYTHON] When I run the exe file with pyinstaller, my PC crashes.

I ran the code below in jupyter notebook and I was able to create an exe file, but when I ran it, my PC was forced to return to the logout screen. (Using mac) The size of the exe file is 8.2MB.

Tkinter.ipynb


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

If you remove the above, it will not drop, but you will get the error "tcl data directory not found".

If anyone is familiar with it, could you please tell me the solution?

Tkinter.ipynb



import tkinter as tk

class Application(tk.Frame):
    def __init__(self, master):
        super().__init__(master)
        self.pack()
        
        master.geometry("500x200")
        master.title("Test software")
        
        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="Run", 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

Recommended Posts

When I run the exe file with pyinstaller, my PC crashes.
VS Code freezes & PC crashes when I start the server with go
When I get an error with PyInstaller
EXE the application created with PyQt5 with PyInstaller
Creating an exe file with Python PyInstaller: PC freezes in parallel processing
Get the location of the file where the exe is placed when the exe created by PyInstaller is executed
I tried to touch the CSV file with Python
I can't exe a project using PyWebView with PyInstaller
[Python Kivy] How to create an exe file with pyinstaller
I tried to divide the file into folders with Python
When I try to run the pip command after updating pip, I get "No such file or directory"
[AWS / Tello] I tried operating the drone with my voice Part2
How to get the directory where the EXE built with Pyinstaller exists
I want to run the Python GUI when starting Raspberry Pi
[AWS / Tello] I tried operating the drone with my voice Part1
I want to check the position of my face with OpenCV!
Solution when an error occurs when hiding the console screen with PyInstaller
Extract the xz file with python
Run the app with Flask + Heroku
I liked the tweet with python. ..
Make Scrapy an exe with Pyinstaller
Open the file with the default app
Run tests automatically when saving file
When I tried to run Python, it was skipped to the Microsoft Store
I want to express my feelings with the lyrics of Mr. Children
Convert the program that imports Google's client library to .exe with pyinstaller