python / tkinter

Discussions Regarding Software

Moderator: Moderators

Post Reply
Baby Hen
Posts: 5
Joined: Tue Nov 03, 2015 13:35

python / tkinter

Post by bremsbackl » Mon Mar 02, 2020 15:58


I can't import tkinter in python - but I don't know what's wrong. What did I try already:

1) start python
Python 3.6.9 (default, Dec 6 2019, 13:53:25)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

2) import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tkinter'

3) help ('modules') , I'll only show the first few lines...
Please wait a moment while I gather a list of all available modules...

Unable to import Tkinter, likely need to install a separate package (python-tk) to have Tkinter support.

4) open a new xterm and 'equo search python | grep -i tk'
--> no hint, in which package tkinter may be hidden

5) Now I'm at a loss - any clues as to what I'm doing wrong?

kind regards

Baby Hen
Posts: 12
Joined: Sat Mar 31, 2018 15:01

Re: python / tkinter

Post by welele » Tue Mar 31, 2020 15:45


tkinter is not present by default in python package. It is pulled by [tk] useflag, which is not present in sabayon package.
You need to emerge dev-lang/python with tk use flag enable :
USE="tk" emerge dev-lang/python

or add "dev-lang/python tk" to a file /etc/portage/package.use/02-python.use and then "emerge dev-lang/python"

Post Reply