之前逛百度时看见一串python里turtle的代码,想着复制下来试试好不好用结果运行时候报错了,问问怎么解决
报的错是什么
看看报错
Traceback (most recent call last):
File "D:\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "D:\PyCharm Community Edition 2022.1.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\PyCharm Community Edition 2022.1.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/pythoncode/ch2/5.py", line 54, in t = T.Turtle()
File "D:\lib\turtle.py", line 3812, in init Turtle._screen = Screen()
File "D:\lib\turtle.py", line 3662, in Screen Turtle._screen = _Screen()
File "D:\lib\turtle.py", line 3678, in init _Screen._root = self._root = Root()
File "D:\lib\turtle.py", line 434, in init TK.Tk.init(self)
File "D:\lib\tkinter_init.py", line 2261, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)_tkinter.TclError: Can't find a usable init.tcl in the following directories:
D:/lib/tcl8.6 D:/lib/tcl8.6 D:/lib/tcl8.6 D:/library D:/library D:/tcl8.6.9/library D:/tcl8.6.9/librar
This probably means that Tcl wasn't installed properly.