ParthJadhav / Tkinter-Designer

An easy and fast way to create a Python GUI 🐍
BSD 3-Clause "New" or "Revised" License
9.26k stars 849 forks source link

got TclError when code excuted with jupyter notebook #433

Open xix1 opened 3 months ago

xix1 commented 3 months ago

Hi, for some reason, I need to use tkinter with jupyter notebook, and when I excuted a small length of code, I got the TclError message. Please help me to address it. Or it just not work with it?


TclError Traceback (most recent call last) Cell In[16], line 2 1 from tkinter import * ----> 2 root = Tk()
3 root.mainloop()

File /usr/local/lib/python3.9/tkinter/init.py:2270, in Tk.init(self, screenName, baseName, className, useTk, sync, use) 2268 baseName = baseName + ext 2269 interactive = False -> 2270 self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) 2271 if useTk: 2272 self._loadtk()

TclError: no display name and no $DISPLAY environment variable