jeanphix / Ghost.py

Webkit based scriptable web browser for python.
http://ghost-py.readthedocs.org/en/latest/
2.77k stars 380 forks source link

"ImportError: No module named QtWebKit" with PySide #168

Open blueyed opened 10 years ago

blueyed commented 10 years ago

I have tried to use Ghost.py (from master), after pip install pyside (version 1.2.2), and it does not appear to work:

----> 1 from ghost import Ghost

…/Ghost.py/ghost/__init__.py in <module>()
----> 1 from .ghost import Ghost, Error, TimeoutError
      2 from .test import GhostTestCase

…/Ghost.py/ghost/ghost.py in <module>()
     66 QNetworkCookie = QtNetwork.QNetworkCookie
     67 
---> 68 QtWebKit = _import('QtWebKit')
     69 
     70 

…/Ghost.py/ghost/ghost.py in _import(name)
     35 def _import(name):
     36     name = "%s.%s" % (binding.__name__, name)
---> 37     module = __import__(name)
     38     for n in name.split(".")[1:]:
     39         module = getattr(module, n)

ImportError: No module named QtWebKit

I would like to see more verbose installation instructions in this regard: a few words about PyQt and PySide (which to prefer?) and a section about installing it via pip or Ubuntu/Debian packages.

blueyed commented 10 years ago

Installing the Debian/Ubuntu package python-pyside.qtwebkit appears to be enough (no pip install pyside necessary), but only for system-wide installations then.

blueyed commented 10 years ago

FWIW, I came across python-qt, maybe that's useful, but probably know already and/or outdated?!

FWIW^2, I've found a useful script to copy packages into a virtualenv: https://gist.github.com/davidfraser/6555916. Very useful, since PySide takes a long time to build (should have created a wheel directly in the first place).