Why tkinter fails on Mac

I was using tkinter on Mac. But when I used the following simple code, the computer will restart.

import tkinter as tk
window = tk.Tk()

What is the problem? Thank you!

  • Mac: Mojave, version 10.14.6
  • tkinter: version 8.6
  • python: 3.7.3

1 answer