Bug 199629

Summary: ImportError: cannot import name _gtk
Product: [Fedora] Fedora Reporter: Nicolas Mailhot <nicolas.mailhot>
Component: pygtk2Assignee: John (J5) Palmieri <johnp>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jkeck, redwolfe, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-28 03:20:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150223, 197822    

Description Nicolas Mailhot 2006-07-20 20:30:26 UTC
Description of problem:
$ system-config-display 
Traceback (most recent call last):
  File "/usr/share/system-config-display/xconf.py", line 364, in ?
    reload(gtk)        
  File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 40, in ?
    from gtk import _gtk
ImportError: cannot import name _gtk

Version-Release number of selected component (if applicable):

gtk2-2.10.0.x86_64
gtk2-2.10.0.i386
system-config-display-1.0.37.noarch
pygtk2-2.9.3.x86_64

Comment 1 Ray Strode [halfline] 2006-07-25 20:20:19 UTC
so the real problem is pygtk's initialization code can't handle being called twice.

if you:

import gtk
and then
reload(gtk)

it fails. Or you if you make import gtk fail initially then it won't work later
when it should:
os.environ["DISPLAY"] = "junk"
import gtk
os.environ["DISPLAY"] = ":0"
import gtk

Comment 2 Matthias Clasen 2006-07-27 13:49:41 UTC
*** Bug 200092 has been marked as a duplicate of this bug. ***

Comment 3 Alexander Larsson 2006-07-28 02:16:52 UTC
pygtk2-2.9.3-3 is building with a fix.


Comment 4 Matthias Clasen 2006-07-28 03:20:48 UTC
fix is in rawhide