PDA

View Full Version : Load a html file: No name 'QtWebEngineWidgets' in module 'PyQt5'



mcanonic
21st June 2019, 11:44
Hi,
I'm trying to load a html file inside a windows but I'm not able to import 'QtWebEngineWidgets' .

I'm using Fedora 29 and I've installed by pip the PQt5 version 5.11.3.

I'm not sure what should I do. Someone suggest to downgrade the PyQt5 version, but I'm sure there should be a smart and more efficient way.

Any suggestion?
The code is really simple:


web = QWebEngineView()
web.load(QUrl("file:///tmp/diff2HtmlCompare-master/index.html"))
web.show()

Thanks,
M

anda_skoa
22nd June 2019, 07:26
Maybe it is packaged as a separate module/package?

When I run "pip search" here on my system I can see a package called "PyQtWebEngine"
Maybe you need that one as well.

Alternatively you could try installing the respective packages of your Linux distribution.

Or go for the official Qt for Python bindings https://doc.qt.io/qtforpython/

Cheers,
_

mcanonic
28th June 2019, 14:26
Maybe it is packaged as a separate module/package?

When I run "pip search" here on my system I can see a package called "PyQtWebEngine"
Maybe you need that one as well.

Alternatively you could try installing the respective packages of your Linux distribution.

Or go for the official Qt for Python bindings https://doc.qt.io/qtforpython/

Cheers,
_

I had to use "pip3 install" instead of "pip install".

Thanks
M