[Python] Why does Python installed via Homebrew not include Tkinter? [duplicate]

Discussão em 'Python' iniciado por Stack, Janeiro 19, 2025.

  1. Stack

    Stack Membro Participativo

    I've installed Python via Homebrew on my Mac.

    brew install python


    After that, I checked my Python version as 2.7.11, and then I tried to perform

    import Tkinter


    I got the following error message:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: No module named _tkinter

    Continue reading...

Compartilhe esta Página