3

I've created a Python app that works perfectly on Mac but I need to be able to run it on Windows. So far, I'm stuck with my QWebEngineView not displaying anything. I've created a small piece of code to test but so far, it only shows a blank window on Win10 while it runs perfectly on MacOS:

from PySide2.QtCore import QUrl
from PySide2.QtWebEngineWidgets import QWebEngineView
from PySide2.QtWidgets import QApplication

APP = QApplication()
web_widget = QWebEngineView()
my_url = QUrl("http://www.google.com")
web_widget.load(my_url)
web_widget.show()
APP.exec_()

It almost looks like Win10 is unable to load/display this webpage, like it's missing some king of component to display this webview... What am I doing wrong?

  • I checked your Windows + PyQt5 example, everything works. Only I added `[]` to `QApplication ([])` – S. Nick Jan 30 '20 at 14:52
  • It seems to be a bug, what version of pyqt5 and pyqtwebengine do you use? – eyllanesc Jan 30 '20 at 17:34
  • @S.Nick The PySide2 QApplication does not need to receive a empty list. – eyllanesc Jan 30 '20 at 17:35
  • I'm currently using PySide2 instead of PyQt. But, if there's a slight chance that it works with PyQt, I'll make the switch right away. Versions-wise, I'm on Python 3.7.6 and PySide2 5.14.0 – Hubert Chauvat Jan 31 '20 at 09:19
  • Check out if `QtWebEngineProcess` is running in task manager. If not it was not found and the problem might be path related. – karlsebal May 06 '20 at 13:59

1 Answers1

3

I ran into the exact same issue.

After quite a while exploring different solutions, the cause was in fact that I was trying to launch my app on a Network Drive.

See this: https://bugreports.qt.io/browse/QTBUG-84632

It worked perfectly on local drive, or by setting the environment variable:

SET QTWEBENGINE_DISABLE_SANDBOX=1

It has been a while since the question was asked. I'm leaving this potential solution here in case of need.

BouBbox
  • 31
  • 3