#๐Ÿ”’ ModuleNotFoundError: No module named '_tkinter'

24 messages ยท Page 1 of 1 (latest)

mossy mural
#

System Information: Apple M1 Mac, Python 3.13, Running in a venv created with python3 -m venv .venv. I don't remember how I installed Python, I think through homebrew

Full Traceback: ```py
Traceback (most recent call last):
File "/Users//Desktop//Coding/Python/Discord_Bots/Scraper Bot/classifier.py", line 1, in <module>
import tkinter as tk
File "/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/init.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_tkinter'

fluid dirgeBOT
#

@mossy mural

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

mossy mural
#

I had a guess it was some homebrew package

#

just didn't know which lol

swift gale
#

For some weird reason it isn't installed by default when you install Python through homebrew

mossy mural
swift gale
#

And then recreate your venv

mossy mural
swift gale
#

Then the easiest way is probably to not install it through homebrew and instead go through the official website which will install it natively

swift gale
lost kernel
#

Just curious. Is there a reason the system python (/usr/bin/python3) won't do? Macs do ship with python...

mossy mural
lost kernel
#

Yah, but the system one might just be complete ๐Ÿ™‚

mossy mural
lost kernel
#

If your OS is up to date the system python shouldn't be too far behind "current".

lost kernel
#

That's plenty for most things, unless you need something recent for a special purpose.

silver burrow
#

i'm still using 3.7 and only things i miss time to time are f"{var = }" and walrus

fluid dirgeBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.