2

First python cannot find _tkinter module: python3 -m _tkinter /Users/owner/.pyenv/versions/3.8.2/bin/python3: No module named _tkinter

I tried installing ActiveTcl and it did successfully. However, my existing Python still cannot find tkinter

How do I configure python to pick up the ActiveTcl and tkinter?

JR DEV
  • 21
  • 3
  • You can’t use an external version of tcl. You need to install a version of python with tkinter – Bryan Oakley May 17 '20 at 16:20
  • I tried reinstall Python (version 3.8.3) and got the same Tkinter module not found. Can someone explain the following post on using "setup.py" to update Python config file to pick up the Tcl /Tk source folder? https://stackoverflow.com/questions/5459444/tkinter-python-may-not-be-configured-for-tk – JR DEV May 17 '20 at 17:01
  • It seems to be a MacOS specific issue - after I install Tcl / Tk directly what's the step to integrate it into the python configuration? – JR DEV May 17 '20 at 17:04
  • 2
    You can’t integrate an external tcl/tk. You need a version of python that is compiled with tkinter. It requires the _tkinter module which is not part of tcl/tk – Bryan Oakley May 17 '20 at 18:22

1 Answers1

0

Tkinter works fine for python installed using Homebrew.

The culprit is "pyenv" and using it to install Python in multiple versions. In this case, the Python runtime fails to find the _tkinter module even after updating the Path variable.

Python not configured for Tk

JR DEV
  • 21
  • 3