Can t import tkinter

0 votes
I am using Python 2.7 for my project and I am trying to import Tkinter. But I get the following error:

ImportError: No module named tkinter

I have tried both "Tkinter" and "tkinter" but have gotten the exact same message. Can anyone help me fix this issue?
May 21, 2019 in Python by ana1504.k
• 7,890 points
497 views

1 answer to this question.

0 votes
You can Try this code to import Tkinter:

try:
    import Tkinter as tk # this is for python2
except:
    import tkinter as tk # this is for python3
answered May 21, 2019 by SDeb
• 13,250 points

Related Questions In Python

0 votes
1 answer

Can't import scikit -learn on python3.

Hi@akhtar, First, remove the Sklearn form your Windows system ...READ MORE

answered Jun 22, 2020 in Python by MD
• 95,060 points
993 views
0 votes
1 answer

Can’t import TensorFlow. Could not find a version that satisfies the requirement TensorFlow

Basically, a solution would be to install ...READ MORE

answered Oct 15, 2020 in Python by anonymous
• 65,870 points
2,147 views
0 votes
1 answer

Error: Can't import matplotlib library.

Install the older version of python, I also ...READ MORE

answered Nov 6, 2020 in Python by Gitika
• 65,870 points
221 views
0 votes
1 answer

TkInter Grid Overlapping Issue

Tkinter is fairly efficient. And for the ...READ MORE

answered Apr 17, 2018 in Python by anonymous
2,038 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,850 views
0 votes
0 answers
0 votes
2 answers

Removing Title bar in Tkinter program

you can remove the title bar by ...READ MORE

answered Mar 19, 2019 in Python by anonymous
10,581 views
0 votes
1 answer

Can't pickle defaultdict

A module-level function is a function which ...READ MORE

answered Apr 8, 2019 in Python by SDeb
• 13,250 points
683 views