FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-02-2009, 09:59 PM
T o n g
 
Default Lenny python - ImportError: No module named _gobject

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
>>>

$ python2.5
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
>>>

Trying to find the answer myself, based on
http://linux.hostweb.com/TopicMessages/alt.os.linux/2046484/1/Default.aspx

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

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

$ dpkg -l | grep python
ii python 2.5.2-3 An interactive high-level object-oriented la
ii python-cairo 1.4.12-1.2 Python bindings for the Cairo vector graphic
ii python-central 0.6.8 register and build utility for Python packag
ii python-dbus 0.82.4-2 simple interprocess messaging system (Python
ii python-glade2 2.12.1-6 GTK+ bindings: Glade support
ii python-gmenu 2.22.2-4 an implementation of the freedesktop menu sp
ii python-gnome2 2.22.0-1 Python bindings for the GNOME desktop enviro
ii python-gobject 2.14.2-1 Python bindings for the GObject library
ii python-gtk2 2.12.1-6 Python bindings for the GTK+ widget set
ii python-gtksour 2.2.0-1+b1 Python bindings for the GtkSourceView widget
ii python-libxml2 2.6.32.dfsg-5 Python bindings for the GNOME XML library
ii python-minimal 2.5.2-3 A minimal subset of the Python language (def
ii python-notify 0.1.1-2+b1 Python bindings for libnotify
ii python-numeric 24.2-9 Numerical (matrix-oriented) Mathematics for
ii python-openssl 0.7-2 Python wrapper around the OpenSSL library
ii python-pyorbit 2.14.3-2 A Python language binding for the ORBit2 COR
ii python-support 0.8.4 automated rebuilding support for Python modu
ii python-twisted 8.1.0-4 Event-based framework for internet applicati
ii python-twisted 8.1.0-4 Event-based framework for internet applicati
ii python-twisted 8.1.0-1 An HTTP protocol implementation together wit
ii python-xdg 0.15-1.1 A python library to access freedesktop.org s
ii python-zopeint 3.3.1-7 The implementation of interface definitions
ii python2.5 2.5.2-15 An interactive high-level object-oriented la
ii python2.5-mini 2.5.2-15 A minimal subset of the Python language (ver

Please help.
Thanks.

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-03-2009, 07:33 PM
Florian Kulzer
 
Default 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 |


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-04-2009, 02:37 AM
T o n g
 
Default Lenny python - ImportError: No module named _gobject

On Tue, 03 Mar 2009 21:33:10 +0100, Florian Kulzer wrote:

>> I get
>>
>> ImportError: No module named _gobject
>>
>> error when running python applications under Lenny. I'm wondering why
>> and how I can fix it. . .
>
> 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:

Thanks Florian for replying, you have always been very helpful.

I've solved it. The problem is due to the unusual stage of my system. My
recent system-wide upgrade broke my alsa and vmware, so I had to revert
and selectively upgrade packages.

Upgrading all packages with python in name didn't solve the problem, so I
upgraded all the dependent packages as well. For the archive, here is the
full list of packages upgraded:

dbus_1.2.1-5_i386.deb
gconf2-common_2.22.0-1_all.deb
gconf2_2.22.0-1_i386.deb
gnome-mime-data_2.18.0-1_all.deb
libart-2.0-2_2.3.20-2_i386.deb
libavahi-glib1_0.6.23-3lenny1_i386.deb
libbonobo2-0_2.22.0-1_i386.deb
libbonobo2-common_2.22.0-1_all.deb
libbonoboui2-0_2.22.0-1_i386.deb
libbonoboui2-common_2.22.0-1_all.deb
libdbus-glib-1-2_0.76-1_i386.deb
libffi5_3.0.7-1_i386.deb
libgail-common_1.22.3-1_i386.deb
libgail18_1.22.3-1_i386.deb
libgconf2-4_2.22.0-1_i386.deb
libglade2-0_1%3a2.6.2-1_i386.deb
libgnome-keyring0_2.22.3-2_i386.deb
libgnome2-0_2.20.1.1-1_i386.deb
libgnome2-common_2.20.1.1-1_all.deb
libgnomecanvas2-0_2.20.1.1-1_i386.deb
libgnomecanvas2-common_2.20.1.1-1_all.deb
libgnomeui-0_2.20.1.1-2_i386.deb
libgnomeui-common_2.20.1.1-2_all.deb
libgnomevfs2-0_1%3a2.22.0-5_i386.deb
libgnomevfs2-common_1%3a2.22.0-5_all.deb
libhal-storage1_0.5.11-8_i386.deb
libidl0_0.8.10-0.1_i386.deb
liborbit2_1%3a2.14.13-0.1_i386.deb

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 11:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org