'error when starting spyder on ubuntu 22.04

I have just upgrade my ubuntu. I have this error on spyder:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
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'

All the solution that I have found deal with specific application developed my different user and not for probel related to upgrade or ubuntu.



Solution 1:[1]

Same problem here!! Everything is updated to the latest version Unbuntu, pytq5 ,etc...

Solution 2:[2]

I had the exact same problem, did a search with the following two items :

"spyder" + "mainwindow.py, line 3624" # aka a piece of the error message

I found the bug report #16571 on spyder's github : "TypeError in Tour with Python 3.10", which identified python 3.10 as the culprit.

In Debian + aptitude I downgraded python 3 from 3.10 to the 3.9 version, launched Spyder again and...problem solved !

Solution 3:[3]

As a quick workaround just comment out the lines in File:

/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py

58

#image = image.scaled(image_width, image_height, Qt.KeepAspectRatio, Qt.SmoothTransformation)

143

#install_gif.setScaledSize(QSize(image_width, image_height))

244-247

#copilot_label.setPixmap(
            #    copilot_image.scaled(image_width, image_height,
            #                         Qt.KeepAspectRatio,
            #                         Qt.SmoothTransformation))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 henke tri
Solution 2
Solution 3 Miguel Angel