Results 1 to 4 of 4

Thread: how to enable python tkinter module?

  1. #1
    Join Date
    Mar 2008
    Beans
    20

    how to enable python tkinter module?

    The Tkinter module needs to be enabled when I install sketcil. Python 2.5 had been installed on my Ubuntu, when I test whether the tkinter is active or not, the following error jumped out,
    jqduan@jqduan-laptop:~/Desktop/Python-2.5.2/Demo/tkinter/guido$ python hello.py
    Traceback (most recent call last):
    File "hello.py", line 4, in ?
    from Tkinter import *
    File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, in ?
    import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: libtk.so.0: cannot open shared object file: No such file or directory

    Therefore I think my tkinter need enabling.As a new to ubuntu, however, I don't know how to enable it. Can anyone help me?

  2. #2
    Join Date
    Sep 2006
    Beans
    Hidden!

    Re: how to enable python tkinter module?

    sudo apt-get install python-tk

  3. #3
    Join Date
    Mar 2008
    Beans
    20

    Re: how to enable python tkinter module?

    After intalling the python-tk, the following error still exists

    jqduan@jqduan-laptop:~/Desktop/Python-2.5.2/Demo/tkinter/guido$ python hello.py
    Traceback (most recent call last):
    File "hello.py", line 4, in ?
    from Tkinter import *
    File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, in ?
    import _tkinter # If this fails your Python may not be configured for Tk
    ImportError: libtk.so.0: cannot open shared object file: No such file or directory

    Thanks anyway.

  4. #4
    Join Date
    Sep 2006
    Beans
    Hidden!

    Re: how to enable python tkinter module?

    It seems that you have a compiled-from-source version of Python 2.4, and the Demo you're running is from Python 2.5

    Ubuntu does not work with that well. try the following do disable your customized version of python:

    sudo rm -f /usr/local/bin/python
    sudo aptitude reinstall python python2.5
    sudo aptitude reinstall python-tk

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •