Anki fails to start because QWebEngineView is not defined (missing import)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
anki (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Disco |
Fix Released
|
High
|
Unassigned | ||
Eoan |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
Due to changes in PyQt (according to Arch), the Anki application fails to run because library imports have been altered in a way that causes the application to not execute and start under any circumstances.
This makes the application as is currently unusable.
[Test Case]
(1) Install Ubuntu Disco or Ubuntu Eoan.
(2) Install anki from repositories as-is (2.1.8+dfsg-1)
(3) Attempt to run `anki` on command line, you get the traceback stated in the original description.
(4) Use the PPA or the version in the repos/proposed.
(5) Anki properly runs without error and starts up as expected.
[Regression Potential]
From a code perspective, the only thing we do is we pull in all the libraries and classes from PyQt5.QtWebEngi
However, in the intervening *short term*, this change does not introduce any major code or functional changes other than to make the various classes available for use, and the regression risk from this change is minimal.
[Additional Information]
This was tested in a Disco and an Eoan VM running inside VMware. The test cases were both able to be tested without issue there, and are as written.
There is a PPA with these changes available, linked in the comments.
[Original Description]
Trying to start Anki version 2.1.8+dfsg-1 from Ubuntu 19.04 fails with the following error:
Traceback (most recent call last):
File "/usr/bin/anki", line 6, in <module>
import aqt
File "/usr/share/
import aqt.forms
File "/usr/share/
from . import about
File "/usr/share/
from aqt.webview import AnkiWebView
File "/usr/share/
class AnkiWebView(
NameError: name 'QWebEngineView' is not defined
This appears to be due to changes in the PyQt, as described in this Arch bug report: https:/
The patch suggested there by Antonio Rojas works on my Ubuntu 19.04 system, too:
--- /usr/share/
+++ /usr/share/
@@ -13,7 +13,7 @@
from PyQt5.Qt import *
# trigger explicit message in case of missing libraries
# instead of silently failing to import
-from PyQt5.QtWebEngi
+from PyQt5.QtWebEngi
try:
from PyQt5 import sip
except ImportError:
tags: | added: disco patch |
Changed in anki (Ubuntu Disco): | |
assignee: | Thomas Ward (teward) → nobody |
status: | Confirmed → In Progress |
Changed in anki (Ubuntu Eoan): | |
assignee: | Thomas Ward (teward) → nobody |
Status changed to 'Confirmed' because the bug affects multiple users.