error when starting spyder on ubuntu 22.04
Asked Answered
A

3

8

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.

Assibilate answered 4/5, 2022 at 14:15 Comment(2)
Did you try what the first line told you to do?Ilanailangilang
It is not clear what do you mean. QT_QPA_PLATFORM=wayland in terminal does not work.Assibilate
R
9

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))
Rodin answered 31/5, 2022 at 19:21 Comment(1)
In my case, I just commented all the cases where I received an error in install.py, which were not exactly these lines...After this, it workedRiata
N
7

(Spyder maintainer here) The Spyder package provided by Ubuntu 22.04 (4.2.1, released in December 2020) is broken with the Python version that comes with it (3.10).

However, this error was fixed in Spyder 5.3.0, released in March 2022. So, to solve this problem please uninstall the Spyder that comes with Ubuntu and install it with pip in a virtualenv, as explained in our documentation.

Nata answered 4/6, 2022 at 20:35 Comment(1)
Installation worked but it does not run because still something seems missing.Mistrust
P
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 !

Pizarro answered 7/5, 2022 at 14:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.