Pygtk but no gtk?

C

chengiz

I am trying to build an app that requires pygtk so I installed the
latter. The app does the following:
import pygtk
....
import gtk

This crashes with
ImportError: No module named gtk.

I dont know where to get this gtk module from. I assumed pygtk would be
it coz the app doesnt mention any dependency on gtk, also googling
didnt find anything but pygtk. Did I screw up the installation or
something? I dont find any gtk.py file in the python library
directories.

Thank you.
Khan
 
J

Jonathan Smith

I am trying to build an app that requires pygtk so I installed the
latter. The app does the following:
import pygtk
...
import gtk

This crashes with
ImportError: No module named gtk.

I dont know where to get this gtk module from. I assumed pygtk would be
it coz the app doesnt mention any dependency on gtk, also googling
didnt find anything but pygtk. Did I screw up the installation or
something? I dont find any gtk.py file in the python library
directories.

Thank you.
Khan

my pygtk provides
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py, which contains
the gtk module. You should ensure that you have that file, and if not,
find out where to get it.

-smithj
 
C

chengiz

my pygtk provides
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py, which contains
the gtk module. You should ensure that you have that file, and if not,
find out where to get it.

I had the files stored in my local space and my PYTHONPATH was wrong.
It seems PYTHONPATH should contain both ...lib/python2.x and
....lib/python2.x/site-packages while mine was simply ...lib (one'd
expect them to actually mention this in the documentation). Once I
fixed PYTHONPATH, it ran fine, although I still cant figure out why it
got pygtk in the first place coz it wasnt in PYTHONPATH the first time.

Khan
 
F

Fulvio

***********************
Your mail has been scanned by InterScan MSS.
***********************


my pygtk provides
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py, which contains
the gtk module

Great advice. I've tried >:
$ ls /usr/lib/python2.4/site-packages/gtk-2.0
atk.so dsextras.py dsextras.pyc dsextras.pyo gobject.so gtk
pangocairo.so pango.so

So, I found some problem related this, would you please post the content of
that file?

NOTE there's one more directory in that position and has its own __init__.

F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top