I have Python version 3.6.5

import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtWebKit import * from PyQt5.QtWebKitWidgets import * from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow 

2 answers 2

You probably have a pretty fresh version of Qt. And there already QWebKit replaced by QWebEngine .

  • ModuleNotFoundError: No module named 'PyQt5.QWebEngine - Slavik0981
  • @ Slavik0981 here you can see that the common module is called a bit wrong. Use the documentation;) - I stand alone

You have an error, it will be correct to access WebEngine :

 ... from PyQt5.QtWebEngine import * from PyQt5.QtWebEngineWidgets import * ... 

Example:

 from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEngineView app = QApplication([]) view = QWebEngineView() view.show() url = 'https://ru.stackoverflow.com/a/864975/201445' view.load(QUrl(url)) app.exec() 

Ps. WebKit was only supported for Qt4 in the pyqt4 and pyside .