[jammy] spyder does not start because of kite install widget

Bug #1972112 reported by Gereon Such
86
This bug affects 18 people
Affects Status Importance Assigned to Milestone
spyder (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

On clean install, python3-spyder crashes on startup. This is caused by a float variable which should be an integer in file /usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py

There are multiple images created in the script, and all of them are scaled. The scaling factors are floats, thus the size parameters are floats, and the pyqt backend crashes from this.

Example from line 56:
image_height = image.height() * 0.5
should be changed to
image_height = int(image.height() * 0.5)
This has to be done in lines 56, 57, 142, 143, 243, 244, then we're good to go and the ide starts up.

I would have commited a fix to a file, if the code was stored in a common repository, but I'm not sure where the plugin source code originates from as it is not part of the regular spyder repo at github (https://github.com/spyder-ide/spyder/tree/master/spyder/plugins/completion does not contain kite...)

Nonetheless, I hope you guys can patch it as necessary.

Yours sincerely,
Gereon

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: python3-spyder 4.2.1+dfsg1-3 [modified: usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py]
ProcVersionSignature: Ubuntu 5.15.0-27.28-generic 5.15.30
Uname: Linux 5.15.0-27-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun May 8 20:41:01 2022
InstallationDate: Installed on 2022-05-08 (0 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
PackageArchitecture: all
SourcePackage: spyder
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Gereon Such (gereonsuch) wrote :
Revision history for this message
Lenin (gagarin) wrote :

I confirm this bug exists, the workaround is pretty easy you have to (int) the returned values in several files, patch following soon... hint from: https://github.com/spyder-ide/spyder/pull/16574

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

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

Changed in spyder (Ubuntu):
status: New → Confirmed
Revision history for this message
Lenin (gagarin) wrote (last edit ):

https://sid.ethz.ch/return.patch

cd /usr/lib/python3/dist-packages/spyder/
patch -p1 < /home/you/return.patch

Revision history for this message
Norbert (nrbrtx) wrote (last edit ):

Confirmed on fresh install of Ubuntu MATE 22.04 LTS.

Who is really responsible with releasing broken Spyder3 on the LTS system to be used for next 5-10 years?

Please prepare SRU instantly!!!1111

Revision history for this message
Norbert (nrbrtx) wrote :

patch

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

The attachment "return.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

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

tags: added: patch
Revision history for this message
der_vegi (m-may) wrote :

Thanks for the patch, it also works for me. It would be great if the package could be updated soon.

Lenin (gagarin)
summary: - spyder does not start in jelly because of kite install widget
+ spyder does not start in jammy because of kite install widget
Revision history for this message
Rolando Garza (rolandog) wrote : Re: spyder does not start in jammy because of kite install widget

I added a member of the 'Debian Science Team' that are listed as maintainers of the package, so that they may hopefully help us get the fix pushed out.

Revision history for this message
Clemens Drüe (druee) wrote :

Spyder 4.1.2 is broken in several other ways, too:
It keeps occasionally crashing with this issue:

  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 71, in wrapper
    out = await method(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 482, in _async_shutdown_kernel
    await ensure_async(self._kill_kernel())
  File "/usr/lib/python3/dist-packages/spyder/plugins/ipythonconsole/utils/manager.py", line 109, in _kill_kernel
    self.kernel.wait()
AttributeError: 'SpyderKernelManager' object has no attribute 'kernel'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qtconsole/manager.py", line 27, in poll
    super().poll()
  File "/usr/lib/python3/dist-packages/jupyter_client/restarter.py", line 143, in poll
    self.kernel_manager.restart_kernel(now=True, newports=newports)
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 26, in wrapped
    raise e
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "/usr/lib/python3/dist-packages/nest_asyncio.py", line 81, in run_until_complete
    return f.result()
  File "/usr/lib/python3.10/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/usr/lib/python3.10/asyncio/tasks.py", line 232, in __step
    result = coro.send(None)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 523, in _async_restart_kernel
    await ensure_async(self.shutdown_kernel(now=now, restart=True))
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 26, in wrapped
    raise e
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "/usr/lib/python3/dist-packages/nest_asyncio.py", line 81, in run_until_complete
    return f.result()
  File "/usr/lib/python3.10/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/usr/lib/python3.10/asyncio/tasks.py", line 232, in __step
    result = coro.send(None)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 79, in wrapper
    raise e
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 71, in wrapper
    out = await method(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 482, in _async_shutdown_kernel
    await ensure_async(self._kill_kernel())
  File "/usr/lib/python3/dist-packages/spyder/plugins/ipythonconsole/utils/manager.py", line 109, in _kill_kernel
    self.kernel.wait()
AttributeError: 'SpyderKernelManager' object has no attribute 'kernel'. Did you mean: 'ipykernel'?

summary: - spyder does not start in jammy because of kite install widget
+ [jammy] spyder does not start because of kite install widget
Revision history for this message
der_vegi (m-may) wrote :

Still no update of the package though the patch has been here already for four months? It is a bit sad that I have to tell my students when introducing Python and Linux to not use Ubuntu 22.04 because I cannot expect them to manually patch packages if they're new to Linux. :(

Revision history for this message
viot (viot) wrote :

Spyder is updated in the Ubuntu 22.10. (version 5.3.2) and works if you update the system.

If you install the new version, everything seems to work.
Because Ubuntu 22.04 is a LTS version, one can expect the spyder package will be backported soon. Probably, you can install this new version on Ubuntu 22.04, but I did not try.

Revision history for this message
gareth (garethbaxter) wrote :

patch works thank you

Revision history for this message
Gereon Such (gereonsuch) wrote : Re: [Bug 1972112] Re: [jammy] spyder does not start because of kite install widget

Nevermind, i hoped they would have fixed the code in the repo by now...

gareth <email address hidden> schrieb am Fr., 24. Feb. 2023, 12:55:

> patch works thank you
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1972112
>
> Title:
> [jammy] spyder does not start because of kite install widget
>
> Status in spyder package in Ubuntu:
> Confirmed
>
> Bug description:
> On clean install, python3-spyder crashes on startup. This is caused by
> a float variable which should be an integer in file
> /usr/lib/python3/dist-
> packages/spyder/plugins/completion/kite/widgets/install.py
>
> There are multiple images created in the script, and all of them are
> scaled. The scaling factors are floats, thus the size parameters are
> floats, and the pyqt backend crashes from this.
>
> Example from line 56:
> image_height = image.height() * 0.5
> should be changed to
> image_height = int(image.height() * 0.5)
> This has to be done in lines 56, 57, 142, 143, 243, 244, then we're good
> to go and the ide starts up.
>
> I would have commited a fix to a file, if the code was stored in a
> common repository, but I'm not sure where the plugin source code
> originates from as it is not part of the regular spyder repo at github
> (https://github.com/spyder-
> ide/spyder/tree/master/spyder/plugins/completion does not contain
> kite...)
>
> Nonetheless, I hope you guys can patch it as necessary.
>
> Yours sincerely,
> Gereon
>
> ProblemType: Bug
> DistroRelease: Ubuntu 22.04
> Package: python3-spyder 4.2.1+dfsg1-3 [modified:
> usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py]
> ProcVersionSignature: Ubuntu 5.15.0-27.28-generic 5.15.30
> Uname: Linux 5.15.0-27-generic x86_64
> NonfreeKernelModules: nvidia_modeset nvidia
> ApportVersion: 2.20.11-0ubuntu82
> Architecture: amd64
> CasperMD5CheckResult: pass
> CurrentDesktop: ubuntu:GNOME
> Date: Sun May 8 20:41:01 2022
> InstallationDate: Installed on 2022-05-08 (0 days ago)
> InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64
> (20220419)
> PackageArchitecture: all
> SourcePackage: spyder
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/spyder/+bug/1972112/+subscriptions
>
>

Revision history for this message
Lars Behrens (lars-behrens-u) wrote :

Confirming the bug, spyder 4.2.1 does not start in 22.04.2:

------------------------------------------------------------------------
~$ spyder
Traceback (most recent call last):
  File "/usr/bin/spyder", line 33, in <module>
    sys.exit(load_entry_point('spyder==4.2.1', 'gui_scripts', 'spyder')())
  File "/usr/lib/python3/dist-packages/spyder/app/start.py", line 213, in main
    mainwindow.main(options, args)
  File "/usr/lib/python3/dist-packages/spyder/app/mainwindow.py", line 3624, in main
    mainwindow = create_window(app, splash, options, args)
  File "/usr/lib/python3/dist-packages/spyder/app/mainwindow.py", line 3482, in create_window
    main.setup()
  File "/usr/lib/python3/dist-packages/spyder/app/mainwindow.py", line 803, in setup
    self.completions = CompletionManager(self)
  File "/usr/lib/python3/dist-packages/spyder/plugins/completion/plugin.py", line 97, in __init__
    plugin_client = Plugin(self.main)
  File "/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/plugin.py", line 50, in __init__
    self.installer = KiteInstallerDialog(
  File "/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py", line 287, in __init__
    self._integration_widget = KiteIntegrationInfo(self)
  File "/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py", line 58, in __init__
    image = image.scaled(image_width, image_height, Qt.KeepAspectRatio,
TypeError: arguments did not match any overloaded call:
  scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
  scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
------------------------------------------------------------------------

Patching with return.patch from #6 helps. But it would be great if that wouldn't be necessary.

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.