dreampie
dreampie copied to clipboard
import gtk
as in issue #8
can you change import command to
import pygtk
pygtk.require('2.0')
import gtk
since homebrew pygtk works only with this also, on osx dependencies can now be installed with homebrew thanks to https://github.com/mxcl/homebrew/issues/16410 and https://github.com/mxcl/homebrew/issues/16269 only import needs change
First importing pygtk
and then set the required version and finally importing gtk is the recommended way of doing this. This has nothing to do with homebrew. I think pygtk.require
changes what the import gtk
will do.
However, with system python, import pygtk
fails because the pygtk.pth
file is only parsed if it is in a site-packges directory. For brewed python this is true but system python does not know that /usr/local/lib/python2.7/site-packages
is such a dir.
You can work around this by
import site
site.addsitedir('/usr/local/lib/python2.7/site-packages')
and in order to not do this on every startup, you can put this into a sitecustomize.py
file as it is done when you brew install python
. Homerbrew should put this file there even if no python has been brewed.