I use MacOS Mojave and I just started learning tkinter in python 3.7.7, when I tried to run it (through sublime text) It shows this error:
Traceback (most recent call last):
File "/Users/julian/Documents/Ficheros_Python/tkinter.py", line 1, in <module>
import tkinter as Tk
File "/Users/julian/Documents/Ficheros_Python/tkinter.py", line 3, in <module>
root = Tk()
TypeError: 'module' object is not callable
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u "/Users/julian/Documents/Ficheros_Python/tkinter.py"]
[dir: /Users/julian/Documents/Ficheros_Python]
[path: /Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/julian/opt/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin]
I used to have anaconda but I uninstalled it a while ago and I have LaTeX installed but I don't now why its there or why there's xamarin, I need some help please.
Also this is the code I was working on (I also tried with from tkinter import *
but the error its the same):
import tkinter as Tk
root = Tk()
myLabel = Label(root, text="Hello world")
myLabel2 = Label(root, text="Hello world2")
myLabel.grid(row=0, column=0)
myLabel2.grid(row=1, column=5)
root.mainloop()