3

I have just upgraded ubuntu. As a result, spyder is not working anymore. This the error:

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'

This seems to be a bug (here)

what do you suggest? Can I downgrade spyder? is if a feasible solution?

Best

diedro
  • 603

1 Answers1

4

This is a Python 3.10 problem, not a Spyder problem necessarily. which was posted as a comment to the main question by Thomas Ward seems to me to be correct because I was not able to successfully run the Spyder 5 application in either macOS or Ubuntu except by installing it in a Python virtual environment.

Follow these instructions to install the latest version of Spyder (currently Spyder 5.x) in Ubuntu 22.04 or earlier. In Ubuntu 24.04 and later simply run sudo apt install spyder to install Spyder 5.x.

  1. Install Python 3 virtual environment creator.

    sudo apt install python3-virtualenv
    
  2. Run python3 --version to show the python 3.x version. In Ubuntu 22.04 the default Python 3.x version is Python 3.10 which I will use as an example in the next step.

  3. Create a Python virtual environment for Python 3.

    virtualenv -p python3.10 venv  
    source ./venv/bin/activate
    

    The new Python virtual environment for python3.10 will be created in the venv directory which is located in the current directory.

  4. Install the latest version of Spyder.

    pip3 install spyder
    

enter image description here
Spyder 5.3.1 in Ubuntu 22.04 (Click image to enlarge)

karel
  • 122,292
  • 133
  • 301
  • 332