Opened 11 years ago
Last modified 11 years ago
#40179 closed defect
Can't import gi.repository after installing gtk3 — at Initial Version
Reported by: | istlota@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.2.0 |
Keywords: | Cc: | ||
Port: | gtk3 |
Description
After failing to get gtk3 to work, as a hail mark pass, I completely uninstalled MacPorts per section 2.5 of the guide, then reinstalled MacPorts from the source tarball. After that, I only port installed two ports: python27 and gtk3 +x11. That worked without any reported problems. I then coded this simple program which ran okay, but note that it does not use the new gobject-introspection Way of doing things with gtk3:
import gobject from gobject import GObject
class MyClass(GObject):
prop = gobject.property(type=int)
def cb(sender, prop):
print "property '%s' changed on %r." % (prop.name, sender)
inst = MyClass() inst.connect("notify", cb) inst.prop = 42
Next, I coded the following program which does use the gobject-introspection Way. But it fails indicating an import error for the 'from gi.repository import GObject' statement. Why does installing the gtk3 port on my mac end up with python not being able to find gi.repository?
from gi.repository import GObject
class MyClass(GObject.GObject):
prop = GObject.property(type=int)
def cb(sender, prop):
print "property '%s' changed on %r." % (prop.name, sender)
inst = MyClass() inst.connect("notify", cb) inst.prop = 42