大家好,如題所述,我使用如下命令:
turtle.showturtle時,出現以下提示:
---------------------------------------------------------------------------
TclError Traceback (most recent call last)
<ipython-input-4-5d31dc17d528> in <module>
----> 1 turtle.showturtle()
~/anaconda3_501/lib/python3.6/turtle.py in showturtle()
~/anaconda3_501/lib/python3.6/turtle.py in __init__(self, shape, undobuffersize, visible)
3810 visible=_CFG["visible"]):
3811 if Turtle._screen is None:
-> 3812 Turtle._screen = Screen()
3813 RawTurtle.__init__(self, Turtle._screen,
3814 shape=shape,
~/anaconda3_501/lib/python3.6/turtle.py in Screen()
3660 else return the existing one."""
3661 if Turtle._screen is None:
-> 3662 Turtle._screen = _Screen()
3663 return Turtle._screen
3664
~/anaconda3_501/lib/python3.6/turtle.py in __init__(self)
3676 # preserved (perhaps by passing it as an optional parameter)
3677 if _Screen._root is None:
-> 3678 _Screen._root = self._root = _Root()
3679 self._root.title(_Screen._title)
3680 self._root.ondestroy(self._destroy)
~/anaconda3_501/lib/python3.6/turtle.py in __init__(self)
432 """Root class for Screen based on Tkinter."""
433 def __init__(self):
--> 434 TK.Tk.__init__(self)
435
436 def setupcanvas(self, width, height, cwidth, cheight):
~/anaconda3_501/lib/python3.6/tkinter/__init__.py in __init__(self, screenName, baseName, className, useTk, sync, use)
2018 baseName = baseName + ext
2019 interactive = 0
-> 2020 self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
2021 if useTk:
2022 self._loadtk()
TclError: no display name and no $DISPLAY environment variable
我在使用jupeter notebook的時候,亦或者本地使用這個庫,都沒有問題。這問題超出我的解決能力了。請大家幫忙下,謝謝了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/79430.html
下一篇:壓縮感知數字水印
