Visitar URL original
Flet and Winpython incompatibility. · Issue #1701 · winpython/winpython · GitHub
Skip to content

Flet and Winpython incompatibility. #1701

Description

@DJuego

Hi! I just want to let you know that due to limitations in Winpython regarding asyncio, and in particular nest_asyncio, it is not possible to run Flet code from the Spyder console.

Winpython with Spyder has been my go-to Python environment for quite some time, and this is the first serious limitation I have encountered.

I opened an issue on Flet regarding this matter here.

I was also wondering if there is a solution that would circumvent this problem.

Thanks for this project!

DJuego

Activity

  1. stonebig commented on Jul 27, 2025

    @stonebig
    Contributor

    It doesn't look like a WinPython change created the problem.
    It is more likely a Spyder internal change with Spyder-6.0.7 upgrade.

    Did you ask to:

    • an IA
    • Spyder community ?

    If you are lucky, it may just be a default parameter of Spyder that has changed.

  2. stonebig commented on Jul 27, 2025

    @stonebig
    Contributor

    If my hypothesis is correct, the last WinPython without Spyder-6 should work as usual for you.

  3. DJuego commented on Jul 27, 2025

    @DJuego
    Author

    First, thank you for responding so quickly, @stonebig .

    Okay. I'll ask the Spyder community. I attributed the problem to Winpython because when I try to use nest_asyncio to deal with the problem I have with flet, I get: NotImplementedError: asyncio.subprocess is not supported on this platform

    Example code:

    import flet as ft
    import asyncio
    import nest_asyncio
    
    nest_asyncio.apply()  # Parchea el bucle de eventos
    
    def main(page: ft.Page):
        page.title = "Flet counter example"
        page.vertical_alignment = ft.MainAxisAlignment.CENTER
    
        txt_number = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100)
    
        def minus_click(e):
            txt_number.value = str(int(txt_number.value) - 1)
            page.update()
    
        def plus_click(e):
            txt_number.value = str(int(txt_number.value) + 1)
            page.update()
    
        page.add(
            ft.Row(
                [
                    ft.IconButton(ft.Icons.REMOVE, on_click=minus_click),
                    txt_number,
                    ft.IconButton(ft.Icons.ADD, on_click=plus_click),
                ],
                alignment=ft.alignment.center,
            )
        )
    asyncio.run(ft.app(main))

    I'll ask Spyder and see what they think. (I hope).

    Thank you again.

    DJuego

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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