Skip to content

flexx fails with Python 3.14 #754

@edreamleo

Description

@edreamleo

flexx works with Python 3.13 and below in the leo-editor environment. With Python 3.14 it fails during startup as follows:

Traceback (most recent call last):

  File "C:\Repos\leo-editor\leo\core\leoApp.py", line 987, in createBrowserGui
    from flexx import flx

  File "C:\Python\Python3.14\Lib\site-packages\flexx\flx.py", line 9, in <module>
    from .event import *

  File "C:\Python\Python3.14\Lib\site-packages\flexx\event\__init__.py", line 15, in <module>
    from ._loop import Loop, loop

  File "C:\Python\Python3.14\Lib\site-packages\flexx\event\_loop.py", line 480, in <module>
    loop = Loop()

  File "C:\Python\Python3.14\Lib\site-packages\flexx\event\_loop.py", line 47, in __init__
    self.integrate()
    ~~~~~~~~~~~~~~^^

  File "C:\Python\Python3.14\Lib\site-packages\flexx\event\_loop.py", line 389, in integrate
    loop = asyncio.get_event_loop()

  File "C:\Python\Python3.14\Lib\asyncio\events.py", line 715, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
                       % threading.current_thread().name)

RuntimeError: There is no current event loop in thread 'MainThread'.

can not import flexx

This crash is expected. Python 3.14 changed the API for asyncio.

FYI, Leo PR #4413 fixes Leo's server so that it works with Python 3.13. Similar changes might work for flexx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions