-1

I am executing the code on windows system and over Pycharm. I have got an error :

*C:\Users\HP\PycharmProjects\untitled2\venv\Scripts\python.exe C:/Users/HP/PycharmProjects/untitled2/MyBrowser.py Traceback (most recent call last): File "C:/Users/HP/PycharmProjects/untitled2/MyBrowser.py", line 5, in from PyQt5.QtWebEngineView import * ModuleNotFoundError: No module named 'PyQt5.QtWebEngineView'*

How to fix this issue? My code:

    from PyQt5.QtCore import *
    from PyQt5.QtWidgets import *
    from PyQt5.QtGui import *
    from PyQt5.QtWebEngineWidgets import *
    from PyQt5.QtWebEngineView import *

    import sys

    class MainWindow(QMainWindow):
        def __init__(self, *args, **kwargs):
            super(MainWindow, self).__init__(*args, **kwargs)

            self.setWindowTitle(" Shikhar ")
            self.browser = QWebView()
            self.browser.setUrl( QUrl("http://www.google.com") )
            self.setCentralWidget(self.browser)

    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    app.exec()
Striped
  • 2,544
  • 3
  • 25
  • 31

1 Answers1

0

You are using an out of date version of PyQt. Update to v5.5 or higher.

three_pineapples
  • 11,579
  • 5
  • 38
  • 75