Hello,

I've been using PyQt5 for a few applications successfully. However, when trying to set up a web browser, I got the error message "Argument has unexpected type QUrl" on this line.

Qt Code:
  1. self.webView.load(self, url)
To copy to clipboard, switch view to plain text mode 

One of the ways I tried to fix this was by reinstalling PyQt5. After doing so I started getting the error message "ImportError: No Module named 'PyQt5.PyGui
instead. I've tried reinstalling Anaconda, replacing PyQt5 with version 5.6, and switching the tutorial's opening line to "From PyQt5 import *", which leads to the error "NameError: name QWidget is not defined". I'm using Python 3.5 on Windows 7 64-bit. Here's the tutorial I'm trying to follow:

Qt Code:
  1. import sys
  2. from PyQt5.PyGui import *
  3. class MyBrowser(QWidget):
  4. def __init__(self, parent = None):
  5. super(MyBrowser, self).__init__(parent)
  6. self.createLayout()
  7. self.createConnection()
  8. def search(self):
  9. address = str(self.addressBar.text())
  10. if address:
  11. if address.find('://') == -1:
  12. address = 'http://' + address
  13. url = QUrl(address)
  14. kwargs = {}
  15. self.webView.load(self, url)
  16. def createLayout(self):
  17. self.setWindowTitle("keakon's browser")
  18. self.addressBar = QLineEdit()
  19. self.goButton = QPushButton("&GO")
  20. bl = QHBoxLayout()
  21. bl.addWidget(self.addressBar)
  22. bl.addWidget(self.goButton)
  23. self.webView = QWebView()
  24. layout = QVBoxLayout()
  25. layout.addLayout(bl)
  26. layout.addWidget(self.webView)
  27. self.setLayout(layout)
  28. def createConnection(self):
  29. self.addressBar.returnPressed.connect(self.search)
  30. self.addressBar.returnPressed.connect(self.addressBar.selectAll)
  31. self.goButton.clicked.connect(self.search)
  32. self.goButton.clicked.connect(self.addressBar.selectAll)
  33. app = QApplication(sys.argv)
  34. browser = MyBrowser()
  35. browser.show()
  36. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode 

Can anyone help me with these errors or direct me to a site where I can learn what's causing them? I'm not sure how to set up PyQt5 so that it will work again or how to fix the webView function for my computer. Thanks in advance for any help provided.