[Python] "ImportError: No module named gtk" although it is installed

Discussão em 'Python' iniciado por Stack, Março 21, 2025.

  1. Stack

    Stack Membro Participativo

    The following code fails although I have the gtk bindings for python installed. This is a debian machine and I have the package named python-gtk2 installed

    >>> import gtk
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named gtk


    How can I fix this?

    Edit1: Per comment request: Python 2.7.3rc2 (default, May 22 2012, 01:05:47)

    Edit2: Per comment request:

    >>> print sys.path
    ['', '/home/lorb', '/usr/lib/python2.7/dist-packages', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages/SpssClient200', '/usr/local/lib/python2.7/site-packages/spss200']

    Continue reading...

Compartilhe esta Página