ImportError: No module named pygtk

Asked by Kamal Broomes

I've been trying to get this program OOF2 to run but I get this error when I do.

Traceback (most recent call last):
  File "/usr/local/bin/oof2", line 38, in <module>
    oof.run()
  File "/usr/local/lib/python2.7/site-packages/oof2/ooflib/common/oof.py", line 641, in run
    front_end(no_interp) # all non-parallel menu items are executed here.
  File "/usr/local/lib/python2.7/site-packages/oof2/ooflib/common/oof.py", line 357, in front_end
    import pygtk
ImportError: No module named pygtk

There is something wrong with my pygtk?? It's installed and it's the most recent version according to Synaptic Package Manager.
I'm not sure what the problem is here and don't see any obvious errors.

When I try to import it in python I get the same message.

I'm a complete newbie when it comes to Ubuntu so I need a lot of help...

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu pygtk Edit question
Assignee:
No assignee Edit question
Solved by:
Miha Gašperšič
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

dpkg -S oof2; lsb_release -a; uname -a

Thanks

Revision history for this message
Kamal Broomes (bkama1) said :
#2

When entering this command in the terminal: dpkg -S oof2; lsb_release -a; uname -a

I get this output:

dpkg-query: no path found matching pattern *oof2*.
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
Linux Hulk 3.2.0-24-generic-pae #39-Ubuntu SMP Mon May 21 18:54:21 UTC 2012 i686 i686 i386 GNU/Linux

Revision history for this message
Best Miha Gašperšič (miha.gaspersic) said :
#3

Hi Kamal,

you can't install oof2, because you don't have installed Python libraties called pygtk. You can solve this issue with running following this steps explained in this thread: http://www.linuxquestions.org/questions/slackware-14/importerror-no-module-named-pygtk-600029/

This should solve your issue.

If this helps you solve your question, please mark thread as solved.

Regards,
Miha

Revision history for this message
Kamal Broomes (bkama1) said :
#4

Thanks Miha Gašperšič, that solved my question.

Revision history for this message
Kamal Broomes (bkama1) said :
#5

I did what was posted here exactly if anyone was wondering.

"Looks like your install of the PyGTK module has gone wrong, To prove this run python from CLI (just type python into your console) and at the python prompt type "import pygtk". You should get the import error again showing that pygtk is not setup right.

If I were you I would download pygobject, pycairo and pygtk from Slackbuilds.org and download the sources.

First build and install pygobject, then pycairo then pygtk. Pygtk should now be setup and installed.

Try your "python - import pygtk" procedure again to make sure pygtk is installed. Then run your Devede install again.

Good Luck"

Revision history for this message
jjchn (2236309155-0) said :
#6

Hi friend,

when I install oof2 ,also meet lots of question.I really do not how do it.I try again and again,but failed again and again.
when I type into oof2 in shell,It shows
Traceback (most recent call last):
   file "/usr/local/bin/oof2",line 25,in<module>
       import oof2
ImportError :No module named oof2

I am a complete newbie in UNBUNT.
I need your help to overcome it.thanks
jj come from china.