Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'importerror:': 0.05; 'upgraded': 0.05; 'incompatible': 0.07; 'python': 0.09; '22,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:problems': 0.09; 'gobject': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'module': 0.19; 'changes': 0.20; 'skip:" 30': 0.20; 'skip:" 40': 0.20; 'trying': 0.21; 'import': 0.21; '"",': 0.22; 'header:User- Agent:1': 0.26; 'looks': 0.26; 'setting': 0.26; '(most': 0.27; 'module.': 0.27; 'skip:" 50': 0.27; 'header:X-Complaints-To:1': 0.28; 'subject:/': 0.28; 'run': 0.28; 'writes:': 0.29; 'case,': 0.29; 'e.g.': 0.30; '(and': 0.32; 'file': 0.32; 'getting': 0.33; 'like:': 0.33; 'traceback': 0.33; 'ubuntu': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'similar': 0.35; 'there': 0.35; 'received:org': 0.36; 'skip:g 30': 0.36; 'charset:us-ascii': 0.36; 'two': 0.37; 'quite': 0.37; 'subject:: ': 0.38; 'several': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; '30,': 0.62; 'upgrading': 0.62; 'respect': 0.63; '26,': 0.65; 'received:217': 0.68; 'fact,': 0.69; '12.4': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dieter Maurer Subject: Re: problems importing from /usr/lib/pyshared/ Date: Sat, 12 Jan 2013 08:08:30 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e08a9e.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:eJKyhtxmwCwRG/45S2JYd9cMxhU= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357974522 news.xs4all.nl 6979 [2001:888:2000:d::a6]:47339 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36684 Harold writes: > I recently upgraded my system from ubuntu 11.4 to 12.4 and since run into an issue when trying to import several packages in python2.7, e.g. > > harold@ubuntu:~$ python -c 'import gtk' > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py", line 30, in > import gobject as _gobject > File "/usr/share/pyshared/gobject/__init__.py", line 26, in > from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \ > File "/usr/share/pyshared/glib/__init__.py", line 22, in > from glib._glib import * > ImportError: No module named _glib Ubuntu 12 has introduced important changes with respect to "glib" (and depending packages). In fact, there are now two quite incompatible implementations - the old "static" one and a new "dynamic" one. It looks as if in your case, old and new implementations were mixed. I had a similar problem when upgrading to "Ubuntu 12.4". In my case, it turned out that my (custom) "PYTHONPATH" setting was responsible for getting into the incompatibility. The new way to use "gtk" is via the "gi" (probable "gnome interface") module. It looks like: from gi.repository import Gtk,GdkPixbuf,GObject,Pango,Gdk,Gio