I am trying to create a EXE file using auto-py-to-exe (pyinstaller). My script implements tkinter to create a GUI. However, when I run pyinstaller, this error message appears.
AttributeError: partially initialized module 'tkinter' has no attribute 'Tk' (most likely due to a circular import) 975818 ERROR: Tcl/Tk improperly installed on this system..
I have viewed solutions however none of them are working for me. I found this page to be helpful: PyInstaller exe returning error on a Tkinter script
However, I cannot find the file locations on my computer and do not think they exist.
binary='/System/Library/Frameworks/Tk.framework/Tk':'tk' --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' your_script.py
I did find a script called tcl_Tk.py and it is associated with hooks I read that script and found this:
TODO Shouldn't these be fatal exceptions?
if not tcl_root:
logger.error('Tcl/Tk improperly installed on this system.')
return []
if not os.path.isdir(tcl_root):
logger.error('Tcl data directory "%s" not found.', tcl_root)
return []
if not os.path.isdir(tk_root):
logger.error('Tk data directory "%s" not found.', tk_root)
return []
I do not have tk_root or Tcl_root installed. And have been using tkinter from Anaconda Navigator (anaconda3) environment
Other background information: I am using Spyder(3.8) as my IDE
Imports:
import tkinter as tk, import pandas as pd, from PIL import Image, ImageTk, import matplotlib.pyplot as plt, plt.style.use('ggplot')
Any solutions how I can get this to work?