[SRU] Spyder won't start (ImportError: No module named QtWebKit)

Bug #1620300 reported by Leonardo Corato
88
This bug affects 14 people
Affects Status Importance Assigned to Milestone
spyder (Debian)
Fix Released
Unknown
spyder (Ubuntu)
Fix Released
High
Unassigned
Yakkety
Fix Released
High
Unassigned
Zesty
Fix Released
High
Unassigned

Bug Description

Spyder won't start at all because Qt4WebKit has been removed. No small fix can be applied. To fix this, we must either re-introduce Qt4WebKit and use the xenial version of spyder (not going to happen), or use the version in zesty that is compatible with Qt5 (what is suggested here). Attachment to comment #12 is a debdiff against the version of spyder in zesty in order to work with the depending packages in yakkety.

[Test Case]
> apt-get install spyder3
> spyder3
ImportError: No module named QtWebKit

[Regression Potential]
can't get any worse

Original report: After installing packages Spyder I tried to launch it but it reported:

** (python:19931): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/spyderlib/spyder.py", line 2331, in main
    mainwindow = run_spyder(app, options, args)
  File "/usr/lib/python2.7/dist-packages/spyderlib/spyder.py", line 2215, in run_spyder
    main.setup()
  File "/usr/lib/python2.7/dist-packages/spyderlib/spyder.py", line 734, in setup
    message=_("Spyder Internal Console\n\n"
  File "/usr/lib/python2.7/dist-packages/spyderlib/plugins/console.py", line 74, in __init__
    self.find_widget.set_editor(self.shell)
  File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/findreplace.py", line 260, in set_editor
    from spyderlib.qt.QtWebKit import QWebView
  File "/usr/lib/python2.7/dist-packages/spyderlib/qt/QtWebKit.py", line 10, in <module>
    from PyQt4.QtWebKit import * # analysis:ignore
ImportError: No module named QtWebKit

A popup stated:
Spyder crashed during last session.

If Spyder does not start at all and before submitting a bug report, please try to reset settings to defaults by running Spyder with the command line option '--reset':
python spyder --reset

Warning: this command will remove all your Spyder configuration files located in '/home/leo/.spyder2-py3').

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: spyder 2.3.8+dfsg1-1build1
ProcVersionSignature: Ubuntu 4.4.0-9136.55-generic 4.4.16
Uname: Linux 4.4.0-9136-generic x86_64
ApportVersion: 2.20.3-0ubuntu7
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Sep 5 14:34:36 2016
InstallationDate: Installed on 2016-09-01 (3 days ago)
InstallationMedia: Ubuntu 16.10 "Yakkety Yak" - Alpha amd64 (20160901)
PackageArchitecture: all
SourcePackage: spyder
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Leonardo Corato (leocor) wrote :
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue nad help making Ubuntu better.

I get the same error message when attempting to start Spyder on Ubuntu Yakkety. I found a corresponding bug report in Debian. It seems like the issue is resolved in newer versions of Spyder but so far this has only been packaged for Debian experimental. Once this has been tested for a while, I would expect it to land in Debian unstable at which point it can be synced to Ubuntu.

Changed in spyder (Ubuntu):
status: New → Confirmed
Changed in spyder (Debian):
status: Unknown → Fix Released
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/mnemosyne/+bug/1633725 Mnemosyne fails to start in Yakkety due to missing QtWebKit

This seems to be the third bug of this nature at least. Is there an upstream package where we should file this bug? Python-qt4?

no longer affects: anki (Ubuntu)
no longer affects: mnemosyne (Ubuntu)
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

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

Here's a temporary fix I tested with Mnemosyne and Anki:

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

Mathew Hodson (mhodson)
Changed in spyder (Ubuntu):
importance: Undecided → High
summary: - Spyder won't start
+ Spyder won't start (ImportError: No module named QtWebKit)
tags: added: zesty
Revision history for this message
Trevor Clark (tkuraku) wrote : Re: Spyder won't start (ImportError: No module named QtWebKit)

See this issue on github: https://github.com/spyder-ide/spyder/issues/3200

Please update to version 3.0.0 which will then work with Qt5.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Spyder 3.0.1+dfsg1-1 has been packaged in Debian Unstable (https://tracker.debian.org/pkg/spyder), and will likely soon be synced to Ubuntu Zesty.

16.10 would still require a fix though... :/

Revision history for this message
Trevor Clark (tkuraku) wrote :

No chance of getting 3.0.1 into 16.10? Even though the current version is unusable?

Revision history for this message
Holger Knust (hknust) wrote :

David Oftedal's downgrade trick worked nicely. I was trying to get Spyder3 running. For Python 3.x it would be

apt-get install python3-pyqt4=4.11.4+dfsg-1build4 python3-pyqt4.qtsql=4.11.4+dfsg-1build4

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>No chance of getting 3.0.1 into 16.10? Even though the current version is unusable?

Note I'm talking in general terms here, but usually packages are changed as little as possible once an Ubuntu version has been released. The main exceptions are Stable Release Updates [1], these are important issues with known small, minimal patches or Backports [2], where a newer version is made available, though in the -backports archive not the main one.

I don't know how these processes are affected when it comes to fixes for packages which doesn't work at all, though it might be worth a shot. :)

In any case, one main requirement is that the fix needs to be in the current development version of Ubuntu before it is applied to older releases. This is to be able to test and ensure that it works as expected before introducing it in older releases.

Spyder 3.0.1+dfsg1-1 has been synced to Ubuntu now [3], but it looks like it hasn't moved from -proposed to the main archive for unknown reasons. Though once it has landed in Ubuntu Zesty properly, someone might look into whether it can be added to 16.10 as well.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates#Procedure
[2]: https://wiki.ubuntu.com/UbuntuBackports
[3]: https://launchpad.net/ubuntu/+source/spyder

Revision history for this message
Scott Howard (showard314) wrote :

This SRU is hard. I tried building 3.0.1+dfsg1-1 for yakkety:
https://launchpad.net/~showard314/+archive/ubuntu/ppa

it builds fine, but can't install because of missing dependencies.
python3-spyder : Depends: python3-nbconvert but it is not installable
                 Depends: python3-qtconsole but it is not installable

1) python3-qtconsole is really "ipython3-qtconsole," the name was changed in debian so that can be easy to fix with a patch in Ubuntu.

2) python3-nbconvert is harder (impossible?) to add since it's a brand new package - and we usually can't get new packages in through SRU. https://packages.debian.org/source/sid/nbconvert

However, Spyder will probably work without nbconvert, it's only used in two spots:
https://github.com/spyder-ide/spyder/blob/28d8b481f2531dca83d3658ae151229601eefb9e/spyder/widgets/explorer.py#L41
https://github.com/spyder-ide/spyder/blob/a3d08162a8f18a8230ef2551af9ef1ac38105711/spyder/widgets/sourcecode/codeeditor.py#L67

Therefore, dropping the nbconvert dependency and changing the python-qtconsole to ipython-qtconsole dependency might be enough to get 3.0.1 through an SRU.

Revision history for this message
Scott Howard (showard314) wrote :

Hello all,

Please test the spyder3 package

sudo add-apt-repository ppa:showard314/ppa
sudo apt-get update
sudo apt-get install spyder3

And attached debdiff against 3.0.1+dfsg1-1 (zesty)
I'll reformat for SRU and request sponsorship

description: updated
summary: - Spyder won't start (ImportError: No module named QtWebKit)
+ [SRU] Spyder won't start (ImportError: No module named QtWebKit)
Revision history for this message
Steve (steve46223) wrote :

The version in Scott Howard's repository is working for me. Thanks!!!

...But minor issue is that some of the graphics backends don't work. (Under Tools --> Preferences --> IPython console or Python console).

For IPython console, the default (inline) works fine, and Qt4 also works fine, but Qt5 doesn't work:

In [1]: import matplotlib.pyplot as plt

In [2]: plt.plot(3,3)
Traceback (most recent call last):

  File "<ipython-input-2-4e78340ee40a>", line 1, in <module>
    plt.plot(3,3)

  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 3146, in plot
    ax = gca()

  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 928, in gca
    return gcf().gca(**kwargs)

  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 578, in gcf
    return figure()

  File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 527, in figure
    **kwargs)

  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_qt5agg.py", line 43, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)

  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_qt5agg.py", line 51, in new_figure_manager_given_figure
    return FigureManagerQT(canvas, num)

  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_qt5.py", line 465, in __init__
    self.toolbar.message.connect(self._show_message)

TypeError: connect() failed between NavigationToolbar2QT.message[str] and _show_message()

For Python console, the default ("automatic") doesn't work (similar error) but one of the other options (Tkinter) works.

But anyway it's entirely usable AFAICT after picking appropriate graphics backends.

Revision history for this message
Xavier Gnata (xavier-gnata-gmail) wrote :

The version in Scott Howard's repository is fine but:
* One detail : It is missing a "depends python3-traitlets". Without this package, spyder3 does not start.
* It would be cool to get a working spyder3 back in the mainline repository. It feels wrong to add ppa on a freshly installed distrib to get my working tools up and running.
* I can reproduce all the problems listed in #13

Revision history for this message
Scott Howard (showard314) wrote :

Bug from Comment #13 is fixed by:
https://github.com/matplotlib/matplotlib/pull/6854/

i'll fix up my ppa and fix up the diff

Revision history for this message
Scott Howard (showard314) wrote :

Actually, comment #13 is a bug in matplotlib:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835455

That would be a separate bug against matplotlib, and a different SRU.

This fix is still ready for upload and awaiting a sponsor. See comment #12.

Revision history for this message
Scott Howard (showard314) wrote :

Re comment #10: spyder is stuck in -proposed because ipython's autopkgtest is failing because of a bug in the autopkgtest case (not iypthon)

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

Revision history for this message
Scott Howard (showard314) wrote :

The fix for yakkety is still ready for upload and awaiting a sponsor. See comment #12.

The fix for zesty is in -proposed, but it looks like there is a circular dependency problem preventing it from migrating:

spyder needs python-qtconsole to migrate, python-qtconsole is not a candidate to migrate because a previous autopkgtest for ipython failed. A new version of ipython has been uploaded that fixes the autopkgtest failure but can't migrate because the current version of glueviz requires the old version of ipython. A new version of glueviz has been uploaded that uses the newest version of ipython, but it can't migrate because it depends on python-qtconsole which can't migrate because a previous autopkgtest it triggered against the old version of ipython failed, and the fixed version of ipython can't migrate because it needs the fixed version of glueviz which is stuck because python-qtconsole... (ad naseum)

Could someone please sponsor this upload for yakkety and trigger python-qtconsole to redo it's autopkgtest?

https://autopkgtest.ubuntu.com/request.cgi?release=zesty&arch=amd64&package=ipython&trigger=python-qtconsole%2F4.2.1-3

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

I approved the tasks for yakkety/zesty of this bug, please fix up properly the metadata.
I also triggered that autopkgtest of ipython (trigger python-qtconsole/4.2.1-3) for the failing archs (not just amd64).

For the SRU, could you propose an uploadable debdiff too?
But I personally won't upload it unless the one in zesty migrates first.

Changed in spyder (Ubuntu Yakkety):
importance: Undecided → High
Changed in spyder (Ubuntu Zesty):
status: Confirmed → Fix Committed
Revision history for this message
Scott Howard (showard314) wrote :

Thank you! How do I change the debdiff in comment 12 so that it is uploadable?

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

Well, there are spurious words about ppa and such. But I suppose I could handle that myself before uploading.
Now it's only really about having the zesty version migrating.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Mattia, as long as the bug is fixed in at least the -proposed development release, it's ok to do the SRU.

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

Anyhow, that migrated 22 hours ago, so this is definitely ready now.
But I'm kinda busy this week at a conference, so if anybody wants to chime in feel free to.

Changed in spyder (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Benjamin Drung (bdrung) wrote :
Revision history for this message
Benjamin Drung (bdrung) wrote :

Here are the steps for creating the spyder_sru.debdiff:

dpkg-source -x spyder_2.3.8+dfsg1-1build1.dsc
dpkg-source -x spyder_3.0.2+dfsg1-0ubuntu0.1.dsc
mv spyder-2.3.8+dfsg1/spyderlib spyder-2.3.8+dfsg1/spyder
diff -Nru --exclude '*.po' --exclude '*.pot' spyder-2.3.8+dfsg1 spyder-3.0.2+dfsg1 > spyder_sru.debdiff

The spyderlib module was renamed to spyder, but the diff is still quite huge. The attached spyder_3.0.2+dfsg1-0ubuntu0.1.debdiff is the diff between the version in zesty and the SRU for yakkety.

Revision history for this message
Benjamin Drung (bdrung) wrote :

...and uploaded to yakkety.

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

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

Changed in spyder (Ubuntu Yakkety):
status: New → Confirmed
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Unsubscribing -sponsors because the fix is already in the Yakkety queue. Thanks Benjamin for your work on it!

Revision history for this message
Paula Thomas (paula11thomas) wrote :

OK, I have uninstalled and reinstalled spyder3 and am still experiencing this problem. Any idea when the fix will make it to the Yakkety repos?

Revision history for this message
Christopher Welborn (cjwelborn) wrote :

Scott Howard's PPA worked for me on Kubuntu 16.10:

    https://bugs.launchpad.net/ubuntu/+source/spyder/+bug/1620300/comments/12

I installed Spyder3 v. 3.0.1 and everything is fine. It uses PyQt5, which is great. The whole problem for me was the PyQt4 thing, and I had no other reason to use it (except for installing spyder).

No more problems, thanks Scott. :)

Revision history for this message
Zach Wolfe (zwolfe21) wrote :

Ubuntu Gnome 16.10: Scott Howard's PPA.

Spyder3 launches (a definite upgrade from the default ver. 2.3.8).
However I am receiving three missing dependencies.

qtconsole >= 4.2.0 : None (NOK)
nbconvert >= 4.0 : None (NOK)
rope >= 0.9.4 : None (NOK)

Note: The only attempt I have made at getting spyder to work in 16.10 is Scott's PPA. Nothing else.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Leonardo, or anyone else affected,

Accepted spyder into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/spyder/3.0.2+dfsg1-0ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in spyder (Ubuntu Yakkety):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Xavier Gnata (xavier-gnata-gmail) wrote :

#32 : It complains that spyder3.1.0 exists and that nbconvert,rope and qtconsole are missing but it "works".
It seems that it is not yet in proposed.

Revision history for this message
Steve (steve46223) wrote :

I confirm that the -proposed version fixes this bug. The program successfully opens now.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Jonathan Polak (jpolak) wrote :

enabling proposed packages fixes spyder not starting. thank you.
a whole bunch of new dependencies were downloaded in apt.
however - upon starting spyder I get a textbox complaining of the following missing dependencies:
    qtconsole >4.2 [NOK]
    nbconvert >4.0 [NOK]
    rope > 0.9.4 [NOK]

Revision history for this message
Jonathan Polak (jpolak) wrote :

just to clarify #35 -
I'm on yakkety. I enabled pre-released updates "yakkety-proposed"
and I pinned it with priority 400 in /etc/apt/preferences.d/proposed-pkgs --- that means I only upgraded the packages I chose (spyder / spyder3) and the direct dependencies of those packages

Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm processing the verification-done SRU queue, but it's unclear to me whether or not the package in yakkety-proposed is sufficiently fixed to be *useful*.

Does it start up enough only to show a textbox about missing dependencies and then be useless? Or can you dismiss the missing-dependency textbox and use the program (presumably with degraded capabilities, as it's missing dependencies)?

If it starts up enough to be useful we can publish it to yakkety-updates. If it just starts up enough to complain about dependencies and then quit, maybe that's not useful to publish :).

Changed in spyder (Ubuntu Yakkety):
status: Fix Committed → Incomplete
Revision history for this message
Benjamin Drung (bdrung) wrote :

Yes, this package in yakkety-proposed is sufficiently useful. You can you dismiss the missing-dependency textbox and use the program. Some features might be missing, but nothing *I* am missing.

Changed in spyder (Ubuntu Yakkety):
status: Incomplete → Fix Committed
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for spyder has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package spyder - 3.0.2+dfsg1-0ubuntu0.1

---------------
spyder (3.0.2+dfsg1-0ubuntu0.1) yakkety; urgency=medium

  * New upstream version, enables spyder to run on yakkety
    (LP: #1620300)
    - New version needed since Qt4WebKit has been removed
    - debian/control: drop dependency on python-nbconvert, rename
      debian python{,3}-qtconsole to ipython{,3}-qtconsole

 -- Scott Howard <email address hidden> Thu, 15 Dec 2016 10:33:23 +0100

Changed in spyder (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
a! (a-guenther) wrote :

I run Kubuntu 16.10 with Spyder 3.0.2, and got back Spyder running after this fix here.

But one of my scripts crashes which was running under Kubuntu 16.04, I think it is due to the missing dependencies mentioned above (e.g. #35) when calling a matplotlib-function:

When doing "fig, ax = plt.subplots(figsize=(8, 6))"
I get:

QObject::connect: Cannot connect NavigationToolbar2QT::message(QString) to (null)::_show_message()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile
    execfile(filename, namespace)
  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)
  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 594, in <module>
    @monkeypatch_method(pdb.Pdb, 'Pdb')
  File "/usr/lib/python3/dist-packages/spyder/utils/site/sitecustomize.py", line 589, in decorator
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3/dist-packages/spyder/widgets/externalshell/monitor.py", line 506, in run
    already_pickled=True)
  File "/usr/lib/python3/dist-packages/spyder/utils/bsdsocket.py", line 51, in write_packet
    nsend -= temp_fail_retry(socket.error, sock.send, sent_data)
  File "/usr/lib/python3/dist-packages/spyder/utils/bsdsocket.py", line 31, in temp_fail_retry
    return fun(*args)
BrokenPipeError: [Errno 32] Broken pipe

Could you confirm this is indeed related to the missing dependencies, and if yes, any idea how to fix it?

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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