GeezerVison is showing github.com — Flet and Winpython incompatibility. · Issue #1701 · winpython/winpython
Flet and Winpython incompatibility. #1701
Description
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
stonebig commented on Jul 27, 2025
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:
If you are lucky, it may just be a default parameter of Spyder that has changed.
stonebig commented on Jul 27, 2025
If my hypothesis is correct, the last WinPython without Spyder-6 should work as usual for you.
DJuego commented on Jul 27, 2025
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
Metadata
Metadata
Development
No branches or pull requestsIssue actions