Re: [pygtk] cannot import gnome

2005-05-23 Thread Thomas Mills Hinkle

> Is there a
> way to find the imported version of some library from the python prompt?

Not sure if this is what you mean, but the following can be useful:

import gtk
gtk.__file__
gtk.gtk_version
gtk.pygtk_version

I'm at work away from my setup so I can't give you the output, but
each of the above can be useful trying to debug a situation like yours
(especially the __file__ attribute, which will tell you where the
module you're looking at came from).

I'd bet you have a gtk/ hanging around in /usr/local/python/site-lib/
or some such which is getting loaded before your apt-getted versions
get touched.

Tom
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] cannot import gnome

2005-05-23 Thread Gustavo J. A. M. Carneiro
On Mon, 2005-05-23 at 12:24 -0300, Christian Robottom Reis wrote:
> On Mon, May 23, 2005 at 04:36:31PM +0200, Martijn Brouwer wrote:
> > Christian Robottom Reis wrote:
> > >On Fri, May 20, 2005 at 01:19:40PM +0200, Martijn Brouwer wrote:
> > >
> > >>I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.
> > >>Importing pygtk in the way described by the tutorial does not work:
> > >>
> > >import pygtk
> > >pygtk.require("2.0")
> > >import gtk
> > >import gnome
> > >>
> > >>Traceback (most recent call last):
> > >> File "", line 1, in ?
> > >>ImportError: No module named gnome
> 
> I've looked at your directories and everything looks find. Could you run
> python with a "-v" option, or "strace -eopen python" and try that again?
> 
> > the gtk and gnome are both installed under 
> > /usr/lib/python2.3/site-packages. gnome is installed in the gtk dir.
> > /usr/bin/python is a link to /usr/bin/python2.3. The versions of the 
> > libraries are taken from my package management system (apt). Is there a 
> > way to find the imported version of some library from the python prompt?
> 
> PyGTK at least offers
> 
> gtk.gtk_version
> gtk.pygtk_version
> 
> I am not sure if GNOME offers something similar, though it is likely.
> Gustavo?

  In more recent gnome-python versions (>= 2.10):

gnome.gnome_python_version

  But since you can't import gnome... :)

  Don't forget to check your PYTHONPATH environment...

> 
> Take care,
> --
> Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125
-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic.


smime.p7s
Description: S/MIME cryptographic signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] cannot import gnome

2005-05-23 Thread Christian Robottom Reis
On Mon, May 23, 2005 at 04:36:31PM +0200, Martijn Brouwer wrote:
> Christian Robottom Reis wrote:
> >On Fri, May 20, 2005 at 01:19:40PM +0200, Martijn Brouwer wrote:
> >
> >>I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.
> >>Importing pygtk in the way described by the tutorial does not work:
> >>
> >import pygtk
> >pygtk.require("2.0")
> >import gtk
> >import gnome
> >>
> >>Traceback (most recent call last):
> >> File "", line 1, in ?
> >>ImportError: No module named gnome

I've looked at your directories and everything looks find. Could you run
python with a "-v" option, or "strace -eopen python" and try that again?

> the gtk and gnome are both installed under 
> /usr/lib/python2.3/site-packages. gnome is installed in the gtk dir.
> /usr/bin/python is a link to /usr/bin/python2.3. The versions of the 
> libraries are taken from my package management system (apt). Is there a 
> way to find the imported version of some library from the python prompt?

PyGTK at least offers

gtk.gtk_version
gtk.pygtk_version

I am not sure if GNOME offers something similar, though it is likely.
Gustavo?

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] cannot import gnome

2005-05-23 Thread Martijn Brouwer

Christian Robottom Reis wrote:

On Fri, May 20, 2005 at 01:19:40PM +0200, Martijn Brouwer wrote:


I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.
Importing pygtk in the way described by the tutorial does not work:


import pygtk
pygtk.require("2.0")
import gtk
import gnome


Traceback (most recent call last):
 File "", line 1, in ?
ImportError: No module named gnome


However, when I do not import pygtk import gnome does work:


import gtk
import gnome



What appears to be happening is that something is very wrong with your
site-packages directory.

- The default gtk being imported does not appear to be the 2.0
  variant
- Gnome appears to be installed fine for whatever version is the
  default
- Gnome appears to not be installed for the 2.0 variant you are
  using (you say python-gnome-2.6.1, but are you sure?)

What do your site-packages/gtk* and gnome* contents look like?


the gtk and gnome are both installed under 
/usr/lib/python2.3/site-packages. gnome is installed in the gtk dir.
/usr/bin/python is a link to /usr/bin/python2.3. The versions of the 
libraries are taken from my package management system (apt). Is there a 
way to find the imported version of some library from the python prompt?


Bye,

Martijn Brouwer


ls /urs/lib/python2.3/site-packages | grep gtk:

gtk-1.2
gtk-2.0
pygtk.pth
pygtk.py
pygtk.py.python-gtk-1.2
pygtk.py.python2.3-gtk2
pygtk.pyc
pygtk.pyo
wx-2.5.3-gtk2-unicode


ls -l /urs/lib/python2.3/site-packages/gtk-2.0

-rw-r--r--  1 root root   894 Mar 17 17:55 atk.la
-rw-r--r--  1 root root 27664 Mar 17 17:55 atk.so
drwxr-xr-x  2 root root  4096 Dec  2 09:53 bonobo
-rw-r--r--  1 root root 11666 Mar 17 17:55 dsextras.py
-rw-r--r--  1 root root 16990 Mar 29 13:07 dsextras.pyc
-rw-r--r--  1 root root 16990 Mar 29 13:07 dsextras.pyo
-rw-r--r--  1 root root   972 Nov 16  2004 gconf.la
-rw-r--r--  1 root root 42256 Nov 16  2004 gconf.so
drwxr-xr-x  2 root root  4096 Dec  2 09:53 gnome
drwxr-xr-x  2 root root  4096 Dec  2 09:53 gnomeprint
-rw-r--r--  1 root root   900 Mar 17 17:55 gobject.la
-rw-r--r--  1 root root 96816 Mar 17 17:55 gobject.so
drwxr-xr-x  2 root root  4096 Mar 29 13:07 gtk
-rw-r--r--  1 root root  1243 Nov 16  2004 gtkhtml2.la
-rw-r--r--  1 root root 15808 Nov 16  2004 gtkhtml2.so
-rw-r--r--  1 root root   912 Mar 17 17:55 pango.la
-rw-r--r--  1 root root 71736 Mar 17 17:55 pango.so


ls /urs/lib/python2.3/site-packages/gtk-2.0/gtk:

-rw-r--r--  1 root root5166 Mar 17 17:55 __init__.py
-rw-r--r--  1 root root6616 Mar 29 13:07 __init__.pyc
-rw-r--r--  1 root root6616 Mar 29 13:07 __init__.pyo
-rw-r--r--  1 root root1071 Mar 17 17:55 _gtk.la
-rw-r--r--  1 root root 1442032 Mar 17 17:55 _gtk.so
-rw-r--r--  1 root root2630 Mar 17 17:55 compat.py
-rw-r--r--  1 root root2892 Mar 29 13:07 compat.pyc
-rw-r--r--  1 root root2892 Mar 29 13:07 compat.pyo
-rw-r--r--  1 root root1136 Mar 17 17:55 glade.la
-rw-r--r--  1 root root   15864 Mar 17 17:55 glade.so
-rw-r--r--  1 root root   30075 Mar 17 17:55 keysyms.py
-rw-r--r--  1 root root   64158 Mar 29 13:07 keysyms.pyc
-rw-r--r--  1 root root   64158 Mar 29 13:07 keysyms.pyo


ls /urs/lib/python2.3/site-packages/gtk-2.0/gnome:

-rw-r--r--  1 root root281 Nov 16  2004 __init__.py
-rw-r--r--  1 root root372 Dec  2 09:53 __init__.pyc
-rw-r--r--  1 root root372 Dec  2 09:53 __init__.pyo
-rw-r--r--  1 root root   1306 Nov 16  2004 _gnome.la
-rw-r--r--  1 root root  28856 Nov 16  2004 _gnome.so
-rw-r--r--  1 root root   1764 Nov 16  2004 applet.la
-rw-r--r--  1 root root  14648 Nov 16  2004 applet.so
-rw-r--r--  1 root root   1154 Nov 16  2004 canvas.la
-rw-r--r--  1 root root  31160 Nov 16  2004 canvas.so
-rw-r--r--  1 root root   1845 Nov 16  2004 nautilus.la
-rw-r--r--  1 root root  18968 Nov 16  2004 nautilus.so
-rw-r--r--  1 root root   1685 Nov 16  2004 ui.la
-rw-r--r--  1 root root 127780 Nov 16  2004 ui.so
-rw-r--r--  1 root root   1221 Nov 16  2004 vfs.la
-rw-r--r--  1 root root  76276 Nov 16  2004 vfs.so


___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] cannot import gnome

2005-05-21 Thread Eric Jardim
On 5/20/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote:
Hi,I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.Importing pygtk in the way described by the tutorial does not work:
I use Debian Sid and everything is Ok. Even importing just gnome without gtk.

[Eric Jardim]
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] cannot import gnome

2005-05-20 Thread Christian Robottom Reis
On Fri, May 20, 2005 at 01:19:40PM +0200, Martijn Brouwer wrote:
> I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.
> Importing pygtk in the way described by the tutorial does not work:
> >>> import pygtk
> >>> pygtk.require("2.0")
> >>> import gtk
> >>> import gnome
> Traceback (most recent call last):
>   File "", line 1, in ?
> ImportError: No module named gnome
> 
> 
> However, when I do not import pygtk import gnome does work:
> >>> import gtk
> >>> import gnome

What appears to be happening is that something is very wrong with your
site-packages directory.

- The default gtk being imported does not appear to be the 2.0
  variant
- Gnome appears to be installed fine for whatever version is the
  default
- Gnome appears to not be installed for the 2.0 variant you are
  using (you say python-gnome-2.6.1, but are you sure?)

What do your site-packages/gtk* and gnome* contents look like?

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3376 0125
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] cannot import gnome

2005-05-20 Thread Brian
On Fri, 2005-20-05 at 13:19 +0200, Martijn Brouwer wrote:
> Hi,
> I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.
> Importing pygtk in the way described by the tutorial does not work:
>  >>> import pygtk
>  >>> pygtk.require("2.0")
>  >>> import gtk
>  >>> import gnome
> Traceback (most recent call last):
>File "", line 1, in ?
> ImportError: No module named gnome
> 
> 
> However, when I do not import pygtk import gnome does work:
>  >>> import gtk
>  >>> import gnome
>  >>>
> 
> I came across this problem because pybliographic did not start. It 
> import gtk and gnome after pygtk.
> The hal-device-manager works correctly, because it does not first import 
> pygtk.
> Is this a feature change that should be reflected into the code of the 
> applications, or is this a bug?
> 
> Bye,
> 
> 
> Martijn Brouwer
> 
> 
The path variable has gotten messed up.  Did you upgrade python?  Since
I don't know debians workings you will have to get help on the repair by
someone else.
-- 
Brian <[EMAIL PROTECTED]>

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] cannot import gnome

2005-05-20 Thread Martijn Brouwer
Hi,
I have a Debian Sarge system with python 2.3 and python-gnome-2.6.1.
Importing pygtk in the way described by the tutorial does not work:
>>> import pygtk
>>> pygtk.require("2.0")
>>> import gtk
>>> import gnome
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named gnome
However, when I do not import pygtk import gnome does work:
>>> import gtk
>>> import gnome
>>>
I came across this problem because pybliographic did not start. It 
import gtk and gnome after pygtk.
The hal-device-manager works correctly, because it does not first import 
pygtk.
Is this a feature change that should be reflected into the code of the 
applications, or is this a bug?

Bye,
Martijn Brouwer

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/