views:

101

answers:

1

I followed the instructions in this post. Everything installed successfully. However, when I run python I cannot import pygtk. Specifically, it says this:

>>> import pygtk \n “ImportError: No module named pygtk”

I'm guessing I have to do some commands like make or something, but I can't find anywhere where it says what to do. Please help, I am getting very frustrated.

Edit: I should probably mention I'm on Mac OS X

A: 

How are you running python? Is it the one that comes with OSX (/usr/bin/python) or the MacPorts version (/opt/local/bin/python)?

The page you linked to has the instructions for installing pygtk under using MacPorts. So it should run with that installation of python. See the MacPorts wiki for help on how to configure your PATH variable to use the appropriate python installation.

EDIT: Try running the macports python explicitly: "/opt/local/bin/python" and then import pygtk. Also, check under the macports python site-packages directory on the filesystem to see if pygtk exists there (usually something like /opt/local/lib/python2.5/site-packages).

ars
Thanks for the reply, but it didn't seem to work. The command I did was export PATH=/opt/local/bin:/opt/local/sbin:$PATHIf I'm doing it wrong please tell me.
Stranger
Updated my answer. Hope this helps, not sure if it will, but it might reveal some new information in any case.
ars
Thanks for your help. pygtk does not seem to exist in that location.
Stranger
That's odd. Maybe try installing pygtk again (sudo ports pygtk..) and see if it complains. Otherwise, it's probably installing it in a different location -- perhaps someone more familiar with macports can help out. (I added the macports tag to your question.)
ars
Thanks, another odd thing is that now I can't import other modules that I had been using without difficulty before like mechanize and BeautifulSoup
Stranger