doctopus
doctopus

Reputation: 5657

ModuleNotFoundError: No module named '_tkinter' on python 3.8.0 mac OS 10.15.3

Using Python 3.8.0 on Mac OS 10.15.3 (Catalina) with pyenv.

When I try to run a file, it returns:

ModuleNotFoundError: No module named '_tkinter'

I've tried brew install tcl-tk. I'm a little worried that because I'm running python on top of pyenv, any third party tkinter module doesn't get run properly.

Running brew doctor returned:

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  `/Users/jm/.pyenv/shims/python3.7-config
  /Users/jm/.pyenv/shims/python3.7m-config
  /Users/jm/.pyenv/shims/python-config
  /Users/jm/.pyenv/shims/python3-config
  /Users/jm/.pyenv/shims/python3.8-config`

Upvotes: 9

Views: 5784

Answers (3)

subtleseeker
subtleseeker

Reputation: 5293

After trying a bunch of things, this is how it finally worked:

$ brew install python-tk

Upvotes: 9

Teach Chemistry
Teach Chemistry

Reputation: 1

try to use pip3 it's working in my pip3 install tk

Upvotes: 0

mmc
mmc

Reputation: 1

You should install tkinter. To install tkinter write this on console:

pip install tk

Upvotes: -1

Related Questions