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,910 points
1,670 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,300 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 23, 2020 in Python by MD
• 95,460 points
7,058 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,770 points
5,267 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,770 points
1,118 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
4,342 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,466 views
0 votes
1 answer
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
20,476 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,300 points
2,680 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP