[clug] finding and settting the python include path

Gough, Chris Chris.Gough at cit.act.edu.au
Wed Feb 11 07:23:21 GMT 2004


> From: Michael James (Wednesday, 11 February 2004 5:08 pm) wrote:
> 
> Any python hackers care to give a brief tute on includes?
> 
> I have a python application that is not finding
>  an included file despite the fact that it's there,
>  installed from a Suse 9.0 RPM.
> 
> /usr/lib/python2.3/site-packages/gtk-2.0/gnome/gconf.so
> 

are you unsuccessfully trying to 'import gnome'? site-packages is usually in
PYTHONPATH, so you should be able to 'import gtk-2.0' no problems (except I
don't know how the full stop in the package name is going to affect things).

your gtk-2.0 seems to be a 'package', a module of modules. You should be
able to 'from gtk-2.0 import gnome' or 'import gtk-2.0.gnome' without
touching your path. Having said that, the Debian package put
site-packages/gtk-2.0/ on my path, so it's not a strange thing to do either.

> In fact I can bodge the app (meld) into working
>  by putting a symlink in the current directory.
> 
> How do I discover python's include path
>  and where does it get set?
> 
> Is there a way of getting python to have a look around
>  and update it's path?
> 
> Please pardon my complete ignorance of this

Yeah, all right.

> michaelj
> 
> -- 
> Michael James                         michael.james at csiro.au
> System Administrator                    voice:  02 6246 5040
> CSIRO Bioinformatics Facility             fax:  02 6246 5166
> 


Chris Gough
Department of Software Development
Canberra Institute of Technology
ph: +61 (2) 6207 4078

This message is probably intended for anyone who receives it.
It may be intended to be Public Domain. Despite any graffiti
my service provider sticks on the end of outbound mail, you
must consider the content and context in which the message was
sent and then use your own judgment to decide if I was
confident you would kept it a secret between us.
This email, and any attachments, may be confidential and also privileged.
If you are not the intended recipient:

Please notify the sender and delete all copies of this transmission along
with any attachments immediately.
You should not copy or use it for any purpose, nor disclose its contents to
any other person.


More information about the linux mailing list