[resolved upstream] Mnemosyne fails to start in Yakkety due to missing PyQt4-WebKit

Bug #1633725 reported by David Oftedal
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mnemosyne (Debian)
Fix Released
Unknown
mnemosyne (Ubuntu)
Fix Released
High
Unassigned
Yakkety
Triaged
High
Unassigned

Bug Description

Mnemosyne fails to start in Yakkety due to a failure to import QtWebKit.

Traceback (innermost last):
  File "/usr/bin/mnemosyne", line 155, in <module>
    debug_file=options.debug_file)
  File "/usr/lib/python2.7/dist-packages/mnemosyne/libmnemosyne/__init__.py", line 164, in initialise
    self.register_components()
  File "/usr/lib/python2.7/dist-packages/mnemosyne/libmnemosyne/__init__.py", line 215, in register_components
    exec("from %s import %s" % (module_name, class_name))
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/mnemosyne/pyqt_ui/review_wdgt.py", line 5, in <module>
    from PyQt4 import QtCore, QtGui, QtWebKit
 ImportError: cannot import name QtWebKit

Searching with apt-cache reveals that there is a QtWebKit based on Qt4:

python-pyqt5.qtwebkit - Python 2 bindings for Qt5's WebKit module
python-pyside.qtwebkit - Qt 4 WebKit module - Python bindings
python3-pyqt5.qtwebkit - Python 3 bindings for Qt5's WebKit module
python3-pyside.qtwebkit - Qt 4 WebKit module - Python3 bindings

... but installing it manually doesn't prevent the above error:

Traceback (innermost last):
  File "/usr/bin/mnemosyne", line 155, in <module>
    debug_file=options.debug_file)
  File "/usr/lib/python2.7/dist-packages/mnemosyne/libmnemosyne/__init__.py", line 164, in initialise
    self.register_components()
  File "/usr/lib/python2.7/dist-packages/mnemosyne/libmnemosyne/__init__.py", line 215, in register_components
    exec("from %s import %s" % (module_name, class_name))
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/mnemosyne/pyqt_ui/review_wdgt.py", line 5, in <module>
    from PyQt4 import QtCore, QtGui, QtWebKit
 ImportError: cannot import name QtWebKit

Tags: patch yakkety
Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

You need to upgrade to Mnemosyne 2.4 (currently in beta, see our google groups forum) for Qt5 support

Changed in mnemosyne (Ubuntu):
status: New → Fix Committed
Revision history for this message
David Oftedal (rounin) wrote :

This bug doesn't concern Mnemosyne 2.4, though, it concerns the package that's available from Ubuntu repositories in Ubuntu 16.10.
That package doesn't work when installed on the system.

Changed in mnemosyne (Ubuntu):
status: Fix Committed → New
David Oftedal (rounin)
no longer affects: spyder (Ubuntu)
no longer affects: anki (Ubuntu)
Revision history for this message
David Oftedal (rounin) wrote :

See also:
https://bugs.launchpad.net/ubuntu/+source/anki/+bug/1633737 Anki fails to start in Yakkety due to missing QtWebKit
https://bugs.launchpad.net/ubuntu/+source/spyder/+bug/1620300 Spyder won't start

Revision history for this message
David Oftedal (rounin) wrote :

"Some PyQt4 applications fail to start in Yakkety due to missing QtWebKit"
https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/1633819

Changed in mnemosyne (Ubuntu):
status: New → Confirmed
Revision history for this message
David Oftedal (rounin) wrote :

Temporary fix:

1. Add the Xenial repositories to /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ xenial universe
deb http://archive.ubuntu.com/ubuntu/ xenial-updates universe

2. apt-get update

3. Install older version of PyQt4

apt-get install python-qt4=4.11.4+dfsg-1build4 python-qt4-sql=4.11.4+dfsg-1build4

Revision history for this message
themusicgod1 (themusicgod1) wrote :

According to

http://stackoverflow.com/questions/37604532/python-2-7-11-importerror-cannot-import-name-qtwebkit-kali-linux-debian-8

an alternative to including an older version of PyQt4 is a code change in this older version of mnemosyne to Qt5.

Revision history for this message
David Oftedal (rounin) wrote :

Thanks, themusicgod1! That seems like a nice fix as well.

Changed in mnemosyne (Debian):
status: Unknown → New
Revision history for this message
themusicgod1 (themusicgod1) wrote :

@david: easier said than done. There are hundreds of these little changes and a few bigger changes between Qt4->5, including

* a change to the way that "slots" work that is not very intuitive to transfer over how the code works mnemosyne/pyqt_ui/ui_main_wdgt.py

* there's a binary blob in mnemosyne/pyqt_ui/mnemosyne_rc.py that server knows what it's going to take to convert it

* For some reason 'question' isn't getting defined in ReviewWdgt, but maybe that's just my particular changes that are doing this(?)

Revision history for this message
Peter Bienstman (peter-bienstman) wrote :

It's a waste of time trying to convert Mnemosyne 2.2.1 to Qt5 when that work has already been done in Mnemosyne 2.4 (took me several months).

It's probably a better idea to work on packaging 2.4, currently in beta.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Work in progress, this does not actually run" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
summary: - Mnemosyne fails to start in Yakkety due to missing QtWebKit
+ Mnemosyne fails to start in Yakkety due to missing PyQt4-WebKit
Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote : Re: Mnemosyne fails to start in Yakkety due to missing PyQt4-WebKit

@ Peter Bienstmann: That's good news, hope you dont mind me providing the link -

https://groups.google.com/forum/#!topic/mnemosyne-proj-users/Et6uWBbFRjU

Title: Mnemosyne 2.4 beta 1 released (13.Oct 2016)

Wonderful software by the way.

Mathew Hodson (mhodson)
Changed in mnemosyne (Ubuntu):
importance: Undecided → High
Revision history for this message
Daniel Holbach (dholbach) wrote :

It looks like the patch is not ready yet, right? Also can you generate the patch using "diff -ruN"?

Can somebody look into packaging 2.4 beta1 as suggested above? That might be easier than redoing the port.

Until a decision has been reached here, I'll unsubscribe the 'ubuntu-sponsors' team for now.

Revision history for this message
themusicgod1 (themusicgod1) wrote :

yeah not even close to ready.

summary: - Mnemosyne fails to start in Yakkety due to missing PyQt4-WebKit
+ [resolved upstream] Mnemosyne fails to start in Yakkety due to missing
+ PyQt4-WebKit
Revision history for this message
Flames_in_Paradise (ellisistfroh-deactivatedaccount) wrote :

pls confirm/support LP-bug #1650808 (new Verson 2.4) – transferred the debian-bug-ref to there.

Revision history for this message
themusicgod1 (themusicgod1) wrote :

According to #1650808, that change trades off the dependence upon PyQt4-WebKit (which doesn't exist in yakkety) with a dependence on QtWebEngine (which doesn't exist in yakkety)

Jeremy Bícha (jbicha)
Changed in mnemosyne (Ubuntu Yakkety):
importance: Undecided → High
status: New → Triaged
Changed in mnemosyne (Ubuntu):
status: Confirmed → Fix Committed
Changed in mnemosyne (Debian):
status: New → Fix Released
Changed in mnemosyne (Ubuntu):
status: Fix Committed → Fix Released
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.