breeder
breeder

Reputation: 91

IDLE can't import Tkinter. Your Python may not be configured for Tk

I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6.

I typed idle3.2 in the terminal and it gave me:

IDLE can't import Tkinter. Your Python may not be configured for Tk.

So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, I rechecked that I have tclsh on the system, but I still can't manage to open idle3.2.

Any input would be appreciated.

Upvotes: 9

Views: 52424

Answers (8)

artemis_clyde
artemis_clyde

Reputation: 373

On my arch linux system I had the same problem easily solved by typing

yaourt tkinter

and installing the first package community/python-pmw 2.0.1-2 [installed]

Upvotes: 1

JimK
JimK

Reputation: 31

I ran into the same error message when installing python3.4 on Fedora 20. The problem was that tk-devel was not installed during the python configure/make. The explicit steps to do this correctly are

download and extract python3.4 from python.org https://www.python.org/downloads/

Find and install the right tkinter and tk-devel:

yum search tkinter

yum install python3-tkinter-3.3.2-17.fc20.x86_64

yum search tk-devel

yum install tk-devel.x86_64

AFTER these are onboard, cd into the python3.4 package directory and run the configure; make, make install process.

I spent too much time resolving this issue. Hopefully this post will help may others to a quick resolution.

PS stackoverflow is awesome. If google brought you to this article, spend some time and surf around the site.

Upvotes: 2

Stealthman
Stealthman

Reputation: 19

Type "idle-python2.6" in the terminal..it worked for me

Upvotes: 1

ronando_lu
ronando_lu

Reputation: 21

The problem is caused by the version between python and idle not matching. U can check your python version by typing : python Then sudo aptget install the right idle version same with your python version

Upvotes: 2

Andrew
Andrew

Reputation: 21

On Ubuntu:

sudo apt-get install idle

Choose one from

  • idle
  • idle3
  • idle-python2.6
  • idle-python2.7
  • idle-python3.1
  • idle-python3.2

for your python version.

Upvotes: 2

beibei2
beibei2

Reputation: 815

On OSX, this can be resolved with macports by installing the python tkinter package for your python version. In my case, with python 2.7, I ran on the terminal:

sudo port install py27-tkinter

change the "27" to your python version number.

Upvotes: 10

Victor Dodon
Victor Dodon

Reputation: 1874

you need to install tk or tk-dev packages for ubuntu.

Upvotes: 1

Tnelsond
Tnelsond

Reputation: 45

If you installed python-tk and the system is running python 2.6 then it is most likely that you installed Tkinter for python 2.6. Try installing python3-tk.

Upvotes: 1

Related Questions