Spyder crashes on startup due to failure to import Python3Lexer

Description:

Since the upgrade of ipython to version 9, spyder will not start. This is the terminal output:

Traceback (most recent call last):
  File "/usr/bin/spyder", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.13/site-packages/spyder/app/start.py", line 285, in main
    mainwindow.main(options, args)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/spyder/app/mainwindow.py", line 1419, in main
    mainwindow = create_window(MainWindow, app, splash, options, args)
  File "/usr/lib/python3.13/site-packages/spyder/app/utils.py", line 360, in create_window
    main.setup()
    ~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/spyder/app/mainwindow.py", line 677, in setup
    internal_plugins = find_internal_plugins()
  File "/usr/lib/python3.13/site-packages/spyder/app/find_plugins.py", line 45, in find_internal_plugins
    mod = importlib.import_module(entry_point.module)
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3.13/site-packages/spyder/plugins/debugger/plugin.py", line 35, in <module>
    from spyder.plugins.ipythonconsole.widgets.run_conf import IPythonConfigOptions
  File "/usr/lib/python3.13/site-packages/spyder/plugins/ipythonconsole/widgets/__init__.py", line 15, in <module>
    from .debugging import DebuggingWidget
  File "/usr/lib/python3.13/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py", line 20, in <module>
    from IPython.lib.lexers import (
        IPython3Lexer, Python3Lexer, bygroups, using
    )
ImportError: cannot import name 'Python3Lexer' from 'IPython.lib.lexers' (/usr/lib/python3.13/site-packages/IPython/lib/lexers.py)

Reference forum post https://bbs.archlinux.org/viewtopic.php?id=304081

Proposed fix https://github.com/spyder-ide/spyder/commit/60fa8e61a5b694d4f90d9da70d1c9b3a971664b8

Additional info:

Steps to reproduce:

  1. Try to run spyder
Edited by Toolybird