Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in Tour with Python 3.10 #16571

Closed
1 task done
Fellypao opened this issue Oct 11, 2021 · 6 comments
Closed
1 task done

TypeError in Tour with Python 3.10 #16571

Fellypao opened this issue Oct 11, 2021 · 6 comments

Comments

@Fellypao
Copy link

Fellypao commented Oct 11, 2021

Issue Report Checklist

  • Searched the issues page for similar reports
  • [ X] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ X] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [not appliable ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ X] Tried basic troubleshooting (if a bug/error)
    • [not appliable ] Restarted Spyder
    • [ X] Reset preferences with spyder --reset
    • [ not appliable] Reinstalled the latest version of Anaconda
    • [ not appliable] Tried the other applicable steps from the Troubleshooting Guide
  • [ X] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Spyder does not start/work with python 3.10.
The error returned is:

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'

What steps reproduce the problem?

  1. Upgrade to (or install) python 3.10
  2. follow the steps to install Spyder using pip (python3 -m venv spyder-env -> source spyder-env/bin/activate -> pip3 install spyder)
  3. launch Spyder with the commmand spyder

What is the expected output? What do you see instead?

Expected: to start the Spyder IDE
I see the error

Paste Traceback/Error Below (if applicable)

Traceback (most recent call last):
  File "/home/fellype/progs_nao_instalaveis/spyder-env/bin/spyder", line 8, in <module>
    sys.exit(main())
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/start.py", line 236, in main
    mainwindow.main(options, args)
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/mainwindow.py", line 1992, in main
    mainwindow = create_window(MainWindow, app, splash, options, args)
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/utils.py", line 281, in create_window
    main.setup()
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/app/mainwindow.py", line 875, in setup
    PLUGIN_REGISTRY.register_plugin(self, PluginClass,
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/api/plugin_registration/registry.py", line 274, in register_plugin
    instance = self._instantiate_spyder5_plugin(
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/api/plugin_registration/registry.py", line 152, in _instantiate_spyder5_plugin
    plugin_instance = PluginClass(main_window, configuration=CONF)
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/api/plugins/new_api.py", line 294, in __init__
    self._container = container = self.CONTAINER_CLASS(
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/plugins/tours/container.py", line 48, in __init__
    self._tour_dialog = OpenTourDialog(
  File "/home/fellype/progs_nao_instalaveis/spyder-env/lib64/python3.10/site-packages/spyder/plugins/tours/widgets.py", line 1074, 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'

Versions

  • Spyder version: 5.1.5 (from pip)
  • Python version: 3.10.0 (from OS)
  • Qt version: 5.15.3 (from OS)
  • PyQt version: 5.12.3 (from pip)
  • Operating System name/version: Slackware Linux - current (pre 15.0)

Additional info:
Spyder was working fine with python 3.9.7 in the same environment

@ccordoba12
Copy link
Member

Hey @Fellypao, thanks for reporting. We'll try to address this problem in a future release.

@ccordoba12 ccordoba12 added this to the v5.2.1 milestone Oct 11, 2021
@ccordoba12
Copy link
Member

In the meantime, please use Python 3.9 instead.

@rear1019
Copy link
Contributor

This is probably a PyQt issue (and not related to Python 3.10). PyQt 5.14.1 issues the following warning when calling QImage.scaled() with float arguments: <stdin>:1: DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.

@Fellypao Can you please recheck PyQt and Qt versions?

@ccordoba12
Copy link
Member

Thanks for your help @rear1019!

@ccordoba12 ccordoba12 changed the title Spyder does not start/work with python 3.10 TypeError in Tour with PyQt 5.15 Oct 12, 2021
@Fellypao
Copy link
Author

@Fellypao Can you please recheck PyQt and Qt versions?

Output from pip list command in the virtual environment I've installed spyder:
PyQt5 5.12.3
PyQt5-sip 12.9.0

Qt version is 5.15.3, the one shipped with Slackware
The version of PyQt5 installed in OS is 5.15.2

@rear1019
Copy link
Contributor

This is a Python 3.10 “issue” after all. The deprecation has been added in Python 3.8 [1] and is enforced in 3.10 [2].

[1] https://bugs.python.org/issue36048
[2] https://bugs.python.org/issue37999

@ccordoba12 ccordoba12 changed the title TypeError in Tour with PyQt 5.15 TypeError in Tour with Python 3.10 Oct 14, 2021
rear1019 added a commit to procitec/spyder that referenced this issue Aug 7, 2023
ojsl1 pushed a commit to ojsl1/libffado that referenced this issue Apr 9, 2024
Nils Philippsen posted to the ffado-devel list that additional fixes were
needed beyond what was in r2817.  He pointed out that

  spyder-ide/spyder#16571 (comment)

suggests that this might be a PyQt issue rather than python 3.10.  This
patch was supplied by Nils.

As FFADO receives wider testing under python 3.10 and later PyQt 5.x
versions it is possible that further fixes along these lines may be needed.


git-svn-id: http://subversion.ffado.org/ffado/trunk/libffado@2818 2be59082-3212-0410-8809-b0798e1608f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants