I am currently using anaconda and spyder to program python script. When I try to use tkinter. It can run only once. When I try to run the script the second time. It shows the error log: ModuleNotFoundError: No module named 'Tkinter'
from tkinter import filedialog
from tkinter import *
root = Tk()
root.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("jpeg files","*.jpg"),("all files","*.*")))
print (root.filename)
The below is the error message I got from spyder console.
from Tkinter import Tk
ModuleNotFoundError: No module named 'Tkinter'