The plugin is broken. Python said: cannot import name QtWebKit

Bug #1773196 reported by Hadmut Danisch
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
qgis (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

when trying to load the OpenLayersPlugin in qgis there's an error message:

 The plugin is broken. Python said:cannot import name QtWebKit

Reason revealed by strace:

qgis uses /usr/bin/python, which is a link to python 2.7 under ubuntu, and then does not find a particular python lib:

17171 stat("/usr/lib/python2.7/dist-packages/PyQt4/QtWebKit", 0x7ffc1443c810) = -1 ENOENT (No such file or directory)
17171 openat(AT_FDCWD, "/usr/lib/python2.7/dist-packages/PyQt4/QtWebKit.x86_64-linux-gnu.so", O_RDONLY) = -1 ENOENT (No such file or directory)
17171 openat(AT_FDCWD, "/usr/lib/python2.7/dist-packages/PyQt4/QtWebKit.so", O_RDONLY) = -1 ENOENT (No such file or directory)
17171 openat(AT_FDCWD, "/usr/lib/python2.7/dist-packages/PyQt4/QtWebKitmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
17171 openat(AT_FDCWD, "/usr/lib/python2.7/dist-packages/PyQt4/QtWebKit.py", O_RDONLY) = -1 ENOENT (No such file or directory)
17171 openat(AT_FDCWD, "/usr/lib/python2.7/dist-packages/PyQt4/QtWebKit.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)

apt-file says there are no such files in bionic. Bionic offers files for PyQt5, but not PyQt4.

I'm not sure whether this is a problem of that particular plugin or a general standard for qgis, to still use PyQt4.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: qgis 2.18.17+dfsg-1
ProcVersionSignature: Ubuntu 4.15.0-22.24-generic 4.15.17
Uname: Linux 4.15.0-22-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: LXDE
Date: Thu May 24 17:02:59 2018
InstallationDate: Installed on 2018-04-30 (24 days ago)
InstallationMedia: Lubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: qgis
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hadmut Danisch (hadmut) wrote :
Revision history for this message
Jürgen E. Fischer (jef-norbit) wrote : Re: [Bug 1773196] [NEW] The plugin is broken. Python said: cannot import name QtWebKit

Hi Hadmut,

On Thu, 24. May 2018 at 15:15:01 -0000, Hadmut Danisch wrote:
> I'm not sure whether this is a problem of that particular plugin or a general
> standard for qgis, to still use PyQt4.

PyQt4 is not the problem - without it QGIS 2.x wouldn't run at all.

But QtWebKit is not available for PyQt4 anymore in Debian/Ubuntu. IIRC because
the webkit C++ libraries were about to be removed and PyQt4.QtWebKit was
removed upfront. QGIS itself doesn't use it, but a bunch of plugins do -
openlayers being one of them.

So this is not an actual qgis packaging problem, nor an upstream problem, nor a
problem of the plugin.

The removal of the C++ libraries never happened and the QGIS packages from
qgis.org include the PyQt4.QtWebKit bindings based on the still available
libraries.

Jürgen

--
Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50
Software Engineer D-26506 Norden http://www.norbit.de

Revision history for this message
Stefano Maffulli (smaffulli) wrote :

Any idea of a workaround? QGis is of limited use in its current state on Ubuntu/Debian and I don't understand why :(

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qgis (Ubuntu):
status: New → Confirmed
Revision history for this message
Jürgen E. Fischer (jef-norbit) wrote : Re: [Bug 1773196] Re: The plugin is broken. Python said: cannot import name QtWebKit

Hi,
On Mon, 25. Jun 2018 at 00:45:02 -0000, Stefano Maffulli wrote:
> Any idea of a workaround? QGis is of limited use in its current state on
> Ubuntu/Debian and I don't understand why :(

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828031

The packages from qgis.org have a workaround...

Jürgen

--
Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50
Software Engineer D-26506 Norden http://www.norbit.de

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.