What is the reason for AttributeError: module 'tkinter' has no attribute 'TclError'? What is the reason for AttributeError: module 'tkinter' has no attribute 'TclError'? tkinter tkinter

What is the reason for AttributeError: module 'tkinter' has no attribute 'TclError'?


Open /usr/local/lib/python3.6/tkinter/__init__.py with a text editor, and replace:

TclError = tkinter.TclError

with:

TclError = _tkinter.TclError

If this works I think your tkinter files are corrupted, and I'd suggest you reinstall them:

sudo apt-get remove python3-tksudo apt-get install python3-tk