CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

ModuleNotFoundError: No module named 'tkinter.filedialog'

Open JLightMedia opened this issue 2 years ago • 4 comments

Try to puck the .exe file with PyInstaller. And get the error ModuleNotFoundError: No module named 'tinter.filedialog' when try to execute app. I associate extra library reference before export. How to fix it? Screenshot 2023-07-19 at 15 50 12 Screenshot 2023-07-19 at 15 58 20

JLightMedia avatar Jul 19 '23 13:07 JLightMedia

@JLightMedia Import like this; from tkinter import filedialog

Akascape avatar Jul 20 '23 08:07 Akascape

@Akascape - This is an issue with CTk, and it's not advised to change the module's files yourself (locally). I'll make a PR if one doesn't exist already.

EDIT: Unable to reproduce...? In a interactive Python session, I tried importing the file dialog with from tkinter import filedialog and import tkinter.filedialog as filedialog. Both worked.

@JLightMedia - While @Akascape's workaround does work, could you share the details of your Python and customtkinter version? I'm on macOS 12.6.7, looks like you are on Windows 11.

ghost avatar Jul 21 '23 00:07 ghost

Hi every one! It helped! Thank you so much.

JLightMedia avatar Jul 21 '23 09:07 JLightMedia

Hi, I'm having the same problem. I tried to copy both(below) to the "init.py" under "customtkinter" folder file manually but the issue remain: from tkinter import filedialog import tkinter.filedialog as filedialog

please help me.

inonb0608 avatar Sep 09 '24 10:09 inonb0608