[osgeo4w-dev] [osgeo4w] #866: QtWebKit: "ModuleNotFoundError: No module named 'PyQt5.QtWebKit'" (was: QtWebKit ModuleNotFoundError: No module named 'PyQt5.QtWebKit')

OSGeo4W trac_osgeo4w at osgeo.org
Sun Jan 26 00:02:25 PST 2025


#866: QtWebKit: "ModuleNotFoundError: No module named 'PyQt5.QtWebKit'"
------------------------+----------------------------
Reporter:  andreaerdna  |       Owner:  osgeo4w-dev@…
    Type:  defect       |      Status:  closed
Priority:  critical     |   Component:  Package
 Version:               |  Resolution:  fixed
Keywords:               |
------------------------+----------------------------
Changes (by andreaerdna):

 * resolution:   => fixed
 * status:  new => closed
 * summary:  QtWebKit ModuleNotFoundError: No module named 'PyQt5.QtWebKit'
     => QtWebKit: "ModuleNotFoundError: No module named 'PyQt5.QtWebKit'"


Old description:

> Using QGIS 3.40.3 and QGIS 3.34.15
>

> {{{
> from qgis.PyQt.QtWebKit import QWebSettings
> Traceback (most recent call last):
>   File "<input>", line 1, in <module>
>   File "C:\OS5C2A~1/apps/qgis/./python\qgis\utils.py", line 1100, in
> _import
>     mod = _builtin_import(name, globals, locals, fromlist, level)
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "C:\OS5C2A~1/apps/qgis/./python\qgis\PyQt\QtWebKit.py", line 24,
> in <module>
>     from PyQt5.QtWebKit import *
>   File "C:\OS5C2A~1/apps/qgis/./python\qgis\utils.py", line 1100, in
> _import
>     mod = _builtin_import(name, globals, locals, fromlist, level)
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ModuleNotFoundError: No module named 'PyQt5.QtWebKit'
> }}}
>
> I guess this will break a lot of plugins using QtWebKit.

New description:

 Using QGIS 3.40.3 and QGIS 3.34.15
 python3-pyqt5 5.15.11-1

 {{{
 from qgis.PyQt.QtWebKit import QWebSettings
 Traceback (most recent call last):
   File "<input>", line 1, in <module>
   File "C:\OS5C2A~1/apps/qgis/./python\qgis\utils.py", line 1100, in
 _import
     mod = _builtin_import(name, globals, locals, fromlist, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\OS5C2A~1/apps/qgis/./python\qgis\PyQt\QtWebKit.py", line 24, in
 <module>
     from PyQt5.QtWebKit import *
   File "C:\OS5C2A~1/apps/qgis/./python\qgis\utils.py", line 1100, in
 _import
     mod = _builtin_import(name, globals, locals, fromlist, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ModuleNotFoundError: No module named 'PyQt5.QtWebKit'
 }}}

 I guess this will break a lot of plugins using QtWebKit.

--
Comment:

 It looks like the issue no longer occurs with updated python3-pyqt5
 5.15.11-2
-- 
Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/866#comment:1>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the osgeo4w-dev mailing list