[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Lenny python - ImportError: No module named _gobject



On Mon, Mar 02, 2009 at 22:59:12 +0000, T o n g wrote:
> Hi,
>
> I get
>
>  ImportError: No module named _gobject
>
> error when running python applications under Lenny. I'm wondering why and
> how I can fix it:
>
>   $ python
>   Python 2.5.2 (r252:60911, Jan  4 2009, 17:40:26)
>   [GCC 4.3.2] on linux2
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> import gtk
>   Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>     File "/var/lib/python-support/python2.5/gtk-2.0/gtk/__init__.py",
> line 38, in <module>
>       import gobject as _gobject
>     File "/var/lib/python-support/python2.5/gtk-2.0/gobject/__init__.py",
> line 30, in <module>
>       from gobject.constants import *
>     File "/var/lib/python-support/python2.5/gtk-2.0/gobject/
> constants.py", line 22, in <module>
>       from _gobject import type_from_name
>   ImportError: No module named _gobject
>   >>>

[...]

> I think it might be because, (somehow) I have two python packages
> installed in my system: python & python2.5. Neither seems to be
> replaceable.

That is normal; "python" is a dependency package whose purpose it is to
pull in the default python version, i.e. version 2.5 for Lenny.

> Here is a list of all python related package in my box:

[ list edited ]

>   ii  python         2.5.2-3
>   ii  python-gobject 2.14.2-1
>   ii  python-gtk2    2.12.1-6
>   ii  python-minimal 2.5.2-3
>   ii  python-support 0.8.4
>   ii  python2.5      2.5.2-15
>   ii  python2.5-mini 2.5.2-15

It looks like all the relevant packages are installed correctly. Maybe
something is wrong with your module path configuration; please post the
output of these commands:

ls -l /var/lib/python-support/python2.5/gtk-2.0/gobject/

which python python2.5

python -c "import sys; print sys.path"

debsums -e python2.5-minimal

(The "debsums" package is necessary for the last command.)

--
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |


Reply to: