On Tue, Jan 21, 2003 at 11:06:49AM +0000, Thomas Leonard wrote:
> > Well, this is a rox problem now, thankfully, not ours. :-)
> 
> Actually, it might be a PyGTK problem. Looks like the infamous
> ref-counting bug ("this object is only referenced by signal handlers, so
> I'm going to wipe __dict__"):

Well, at least not an installation problem ;) but I concede.

> > pygtk.pth is what tells Python to look in the gtk-2.0 or gtk-1.2
> > directories by default, and I use it as shorthand to refer to the whole
> > pygtk.py debacle. I hate this solution because it is has utterly
> > confusing semantics and has generated about 50% of the list traffic for
> > the last 4 months or so.
> 
> Indeed. I guess there was a need to be compatible with RedHat 8.0 (where
> 'import gtk' has to get 2.0 by default) and everyone else (where it has to
> get 1.2). Perhaps there should be a warning if you forget to import pygtk?

Not exactly. The problem is that 'import gtk' now has utterly undefined
semantics. If you installed pygtk2 and *then* pygtk0, yes, import gtk
gets pygtk0. But if you did it the other way around, you get pygtk2. 

To complicate matters further, you may have installed into a
non-standard directory, used the wrong prefix, etc etc etc.

> [...]
> > There is no need to reinstall Python, and all PyGTK apps will now find
> > pygtk correctly. One thing that many ignore is that the default prefix
> > of /usr/local *MAY NOT BE CORRECT* for your system. If your Python is
> > installed by default to /usr, it definitely isn't - you *must use*
> > --prefix=/usr instead. Just because it's default, in this case, doesn't
> > mean it's correct. 
> 
> Doesn't pygtk.py search sys.path? In that case, it should still find stuff
> in /usr/local, even if python is in /usr (provided /usr/local is in the
> default search path). I think there's a problem if you've installed some

But for Python installed by default with prefix /usr, /usr/local is
not in sys.path, is never searched, and it won't work. Python only looks
in *one* site-packages directory by default, the one inside the
default pythonX.X/lib directory.

The bottom line is: if you install to a prefix which isn't the default
Python prefix, you'll need to hack sys.path manually.

Johan, perhaps we can get a ./configure warning that "You are installing
pygtk into a non-standard directory, and you'll have to fiddle sys.path
to make things work properly."?

> gtk-2.0 bits to one prefix and some to another, though:
> 
>       http://bugzilla.gnome.org/show_bug.cgi?id=70178
> 
> (at the end; I should have opened a separate bug report)

This is yet another problem, really.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to