Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named '_tkinter' #121

Closed
SuperSonicHub1 opened this issue Dec 22, 2021 · 6 comments
Closed

ModuleNotFoundError: No module named '_tkinter' #121

SuperSonicHub1 opened this issue Dec 22, 2021 · 6 comments

Comments

@SuperSonicHub1
Copy link

Trying to use Tkinter and got this:

Traceback (most recent call last):
  File "/home/kwilliams/Software/s1mple_img/s1mple.py", line 108, in <module>
    from tkinter import Tk, Canvas, PhotoImage
  File "/home/kwilliams/.asdf/installs/python/3.10.0/lib/python3.10/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'

How do I configure Tk?

@SuperSonicHub1
Copy link
Author

Still having issues with this. Haven't been able to find good documentation surrounding compiling Python with Tkinter support. Help?

@joaodejesus
Copy link

I'm also having the same problem with tkinter, I use asdf with Arch and WSL, I tried to find a solution but to no avail, so I ended up uninstalling asdf.

@exterm
Copy link

exterm commented Oct 14, 2022

I just tried with 3.8.15 and it looks like it will compile with tk support if the corresponding library is present on your system. For me, on fedora, that was tk-devel.

So what worked for me was

$ asdf uninstall python 3.8.15
$ sudo dnf install tk-devel
$ asdf install  python 3.8.15

Et voila, a python with tk (and thus tkinter) support.

@SuperSonicHub1
Copy link
Author

Thanks!

@MyApaulogies
Copy link

MyApaulogies commented Dec 8, 2023

After sudo dnf install tk-devel and reinstalling, I got a new error: WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib? Running sudo dnf install sqlite-devel, uninstalling and reinstalling fixed this in Fedora 38. (leaving this here in case it helps someone)

@eric-burel
Copy link

eric-burel commented Jan 2, 2024

Hey folks, I am on Ubuntu, any idea why I would hit this issue? The proposes solutions doesn't apply to Debian

Edit: nevermind there is another issue for Ubuntu:
#50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants