When I try to import the python 3
graphical library, turtle
, on my m1 MacBook, I get an error message:
david@Davids-MacBook-Air Python Coding Files % /opt/homebrew/bin/python3 "/Users/david/Desktop/Python Coding Files/hello.py"
Traceback (most recent call last):
File "/Users/david/Desktop/Python Coding Files/hello.py", line 1, in <module>
import turtle
File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 107, in <module>
import tkinter as TK
File "/opt/homebrew/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 37, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
I see it has the library tkinter
written in it for some reason. This is weird because on my other Mac, an intel based Mac, with the same python 3
version, and no library such as tkinter
install, I didnt get an error message when trying to import turtle
Does anybody know what the problem is?