3

I installed tkinter using the following request: sudo apt-get install python3-tk

When I try to import the module using:

 #!/usr/local/lib/python3.4  
 import tkinter as tk

The above two lines resulted in the following error condition (both IDLE and python3 shell)

ImportError: No module named tkinter 

Wits end! - Any insight much appreciated. Thx Tankadere

Shan-Desai
  • 1,541
  • 2
  • 13
  • 28
Tankadere
  • 31
  • 1
  • 1
  • 3

3 Answers3

2

I had this same issue and realized I was using the command

python

when instead I should be using this command

python3

If you use 2.7,

import Tkinter # capital T

if you use 3.4,

import tkinter # lowercase t
1

Try import Tkinter, not import tkinter, because Python is case-sensitive and Tkinter was renamed in latest verisons.

Kerbiter
  • 23
  • 7
-1

On Fedora 25, dnf install python3-tkinter.

goldilocks
  • 60,325
  • 17
  • 117
  • 234