1

I have installed Qt 2.4.1, SIP 4.13.3 and PyQt4 4.9.4 on Mac OSX 10.7.5 for Python 3.2.3.

When I tried to from PyQt4.QtWebkit import QWebPage, I got: ImportError: No module named QtWebkit.

But other modules work fine, such as from PyQt4 import QtGui.

I don't know why. What steps am I missing?

warvariuc
  • 57,116
  • 41
  • 173
  • 227
Sam Wei
  • 99
  • 4
  • 11

1 Answers1

1

Check webkit installed in your system, for finding path

>>> import PyQt4
>>> print PyQt4.__path__
['/usr/lib/python2.7/dist-packages/PyQt4']

check you have QtWebkit there. and check this also

Community
  • 1
  • 1
Achayan
  • 5,720
  • 2
  • 39
  • 61
  • PyQt4.__path__ on my MacBook Pro is /Library/Python/3.2/site-packages/PyQt4. And in that folder I have QtWebKit.so. Does this mean I have QtWebKit installed in my system? – Sam Wei Jul 30 '12 at 01:54
  • Jesus there is a spelling mistake :( `from PyQt4.QtWebKit import QWebPage` this should work if you have QtWebKit.so in ur folder :) – Achayan Jul 30 '12 at 17:39
  • Yes, you're right! Sorry my mistake about the spelling. It works now. Thank you very much! – Sam Wei Jul 31 '12 at 05:28