import error while importing turtle
I am a student and need to work on a project using turtle. I get an importing error when trying to import turtle. I am on Mac OS High Sierra. Following is the code and error:
import turtle
screen = turtle.Screen()
screen.setup(width=800, height=600)
turtle1 = turtle.Turtle()
screen.exitonclick()
Traceback (most recent call last):
File "/Users/kinjalbajadeja/Desktop/CSC121/PythonPrograms/L09/ParmarP1.py", line 1, in <module>
import turtle
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/turtle.py", line 107, in <module>
import tkinter as TK
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_tkinter.so, 2): Library not loaded: /Library/Frameworks/Tcl.framework/Versions/8.4/Tcl
Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload/_tkinter.so
Reason: image not found
请先登录再写评论。
Please try to run this script with the same interpreter in the Terminal. Do you have any error?