You are not logged in.

#1 2013-04-18 21:59:16

Archimaredes
Member
Registered: 2013-01-23
Posts: 60

[SOLVED] pygtk installed, but I cannot import the module in Python

Hi,

I'm attempting to set up Compiz, but when I tried running ccsm I get this:

Traceback (most recent call last):
  File "/usr/bin/ccsm", line 30, in <module>
    import pygtk
ImportError: No module named pygtk

pygtk is installed, and I've actually reinstalled it now (as well as python2, which ccsm uses), but to no effect. If I open a python2 or a python3 prompt, I can't import the pygtk module.

In /usr/lib/python2.7/site-packages there's a folder called gtk-2.0, but it contains nothing apparently related to pygtk. There's nothing relevant in /usr/lib/python3.3/site-packages.

Any help would be appreciated, thanks in advance smile


Edit: Here's a more detailed list of things I can find relating to GTK in python's folders:

$ find /usr/lib/python2.7 -iname *gtk*
/usr/lib/python2.7/site-packages/gtk-2.0
/usr/lib/python2.7/site-packages/gtk-2.0/gtk
/usr/lib/python2.7/site-packages/gtk-2.0/gtk/_gtk.so
/usr/lib/python2.7/site-packages/gtk-2.0/gtkunixprint.so

Seems irrelevant to me. That finds nothing in the python3.3 folder.


Edit 2: Actually, those files don't seem irrelevant now, as I find they come up on pygtk's package file list along with everything else in the gtk-2.0 folder there.
However, if I do

help('modules')

in a Python (2 or 3) prompt, no GTK (or similar) modules show up on the generated list.


Edit 3: Solved! Following advice from bgeddy here, I ran these commands and fixed it:

# pacman -Rdd python2-cairo python2-gobject2 pygtk
# pacman -S pygobject
# pacman -S pycairo
# pacman -S pygtk

Apparently it works in that order. I don't even know how anything went wrong in the first place, but it's solved.

Last edited by Archimaredes (2013-04-18 22:15:28)

Offline

#2 2013-04-18 22:15:37

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] pygtk installed, but I cannot import the module in Python

What is the output of "pacman -Ql pygtk"?

Offline

Board footer

Powered by FluxBB