8

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.

nbro
  • 13,796
  • 25
  • 99
  • 185
breeder
  • 81
  • 1
  • 1
  • 2
  • possible duplicate of [Tkinter: "Python may not be configured for Tk"](http://stackoverflow.com/questions/5459444/tkinter-python-may-not-be-configured-for-tk) – nbro Jan 15 '15 at 03:11

8 Answers8

9

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.

beibei2
  • 785
  • 7
  • 12
2

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.

Josh Darnell
  • 11,096
  • 9
  • 36
  • 63
Andrew
  • 21
  • 1
2

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

ronando_lu
  • 21
  • 1
2

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.

JimK
  • 31
  • 1
1

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]

artemis_clyde
  • 375
  • 2
  • 19
1

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.

Tnelsond
  • 45
  • 7
1

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

Victor Dodon
  • 1,706
  • 3
  • 18
  • 27
0

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