Python Forum
Installing/configuring Tkinter on Linux Mint 18?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing/configuring Tkinter on Linux Mint 18?
#1
I'm having trouble getting TKinter working.

Python 3.6.3 (default, Dec 13 2017, 17:56:50) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
>>> 
I installed python3-tk and its dependencies.

Quote: $ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.2
DISTRIB_CODENAME=sonya
DISTRIB_DESCRIPTION="Linux Mint 18.2 Sonya"

Any thoughts?

Thanks
Reply
#2
On archlinux had to install tcl.
99 percent of computer problems exists between chair and keyboard.
Reply
#3
Already have it...

Quote:$ sudo apt-get install tcl
Reading package lists... Done
Building dependency tree
Reading state information... Done
tcl is already the newest version (8.6.0+9).

I don't see any Python related TCL packages either...
Quote:$ apt-cache search tcl | grep python3
python3-fastcluster - Fast hierarchical clustering routines for Python 3
python3-heatclient - client library and CLI for OpenStack Heat - Python 3.x
python3-pyds9 - Communication with the ds9 image display program (Python-3)
python3-qwt - Pure Python implementation of Qwt - Python 3
python3-rtslib-fb - object API for managing the Linux LIO kernel target - Python 3.x
python3-swiftclient - Client library for Openstack Swift API - Python 3.x
python3-tksnack - Sound extension to Tcl/Tk and Python/Tkinter - Python 3.x library
Reply
#4
I had to install tk. tcl was already install on my archlinux but not tk. Had to remember it.
99 percent of computer problems exists between chair and keyboard.
Reply
#5
Problem solved.

I installed Python 3.6 from source. When I built it, I didn't have Tcl\Tk dev packages installed so the Python build process skipped tkinter. If I noticed at the time (and I doubt that I noticed), I probably thought, "well, I don't use that anyway".

So I installed the appropriate dev package (tk-dev) and rebuilt python.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Window geometry appears different on Win and Linux steve_shambles 6 7,121 Nov-29-2019, 12:30 AM
Last Post: steve_shambles
  [WxPython] [SOLVED]Installing Phoenix in python3 on Linux Barrowman 2 5,244 Jul-25-2017, 05:44 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020