-2

Traceback (most recent call last): File "/Users/kane/study/python/basicDataStructure/liner_data_structure.py", line 2, in <module> from turtle import clear File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/turtle.py", line 107, in <module> import tkinter as TK File "/usr/local/Cellar/python@3.9/3.9.7_1/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'

Note Please note that, I didn't use anything regarding tkinter. I only created a variable and checked its type.

I have found the answer at the link brew install python-tk

kane
  • 1
  • 1
  • Are you sure that the file path is correct? – NodeX4 Feb 06 '22 at 07:57
  • Please note that I did use anything regarding Tkinter or any library else. I have tried to get variable type on python2 and it's OK. When I have tried to get variable type on python3 and it shown the bugs. – kane Feb 06 '22 at 08:04

1 Answers1

-1

You will have to firstly import it on the os device! Run these in your terminal

python3 get-pip.py

Pip install turtle Pip install tkinter

NodeX4
  • 150
  • 1
  • 10