newbie : python path setting on linux

Erik Max Francis max at
Sun Feb 18 14:37:38 EST 2001

Anand Ganesh wrote:

>         I downloaded the python gtk bindings and compiled the module.
> I've a set of files in the directory ~/tmp/pygtk-0.6.6. Now I try to
> run the examples in ~/tmp/pygtk-0.6.6/examples/simple say
> It says :
> ImportError: No module named _gtk
> Now, I tried fiddling with PYTHONPATH and PYTHONHOME. I set PYTHONHOME
> to
> ~/tmp/pygtk-0.6.6 and PYTHONPATH to ./ (b'cos PYTHONHOME is prefixed
> ?).
> Anyways, didnt work. Same error. Infact printing sys.path I find that
> it
> doesnt have ~/tmp/pygtk-0.6.6 on it at all.

Because you didn't add it to it.  PYTHONHOME indicates where the main
Python directory resides (if different from the compiled-in default, if
it's in your path); PYTHONPATH adds additional search paths.  You should
add the directory which the actual gtk module resides in to PYTHONPATH,

 Erik Max Francis / max at /
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ I just don't know why they're shooting at us.
\__/ Capt. Benjamin "Hawkeye" Pierce
    Esperanto reference / http://mirror/alcyone/max/lang/esperanto/
 An Esperanto reference for English speakers.

More information about the Python-list mailing list