2

I need to run an application written in python. When I try to load it from terminal I get this error:

      File "/usr/local/bin/soar", line 3, in <module>
         import form.main
      File "/usr/local/lib/python2.6/site-packages/form/main.py", line 14, in <module>
         from Tkinter import *
      File "/usr/local/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
         import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: No module named _tkinter

I installed python 2.6.6 from the source files. I am really confused!!

How should I install tkinter?

I am running Xubuntu 13.10. You can see the different versions of python already installed in the below:

Python error

How can I remove python2.6.6? I tried to remove all files and folders related to python2.6. Now when I run python, it still loads python 2.6.6 I really have no idea what to do!! I tried to follow the instructions here and here to uninstall it but it did not work, that's why I deleted all the files and folders manually. enter image description here

Community
  • 1
  • 1
Ali
  • 1,001
  • 2
  • 14
  • 32
  • 1
    what happens if you run your program using python 2.7, like `python2.7 soar`? – Fiver Nov 07 '13 at 13:38
  • @Fiver Before installing 2.6.6 it loaded the GUI but it was not working properly. After installing 2.6.6, when I try to run it with 2.7 it says it can no load soar! I am trying a lot of different things. I think I have changed something, that's why it does not run it with 2.7. – Ali Nov 07 '13 at 13:45
  • I know this is almost 10 years later, but: "How should I install tkinter?" By installing the *development* dependency *before recompiling* the local install. System packages like `python-tk` only upgrade the system Python. See the linked duplicate for details. – Karl Knechtel Apr 29 '23 at 02:14

1 Answers1

1

Type the following in your terminal:

sudo apt-get install python-tk

Install python3-tk package if you need Tkinter functionality in the 3rd version of python.

aga
  • 27,954
  • 13
  • 86
  • 121