question: example code doesn't work
python:3.12.12 OS:macOS 15.7.3
I run the following example code in the virtual environment, but the controls failed to load properly. Is it because Flet does not support the virtual environment?
import flet as ft
def main(page: ft.Page):
page.title = "Flet counter example"
page.vertical_alignment = ft.MainAxisAlignment.CENTER
input = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100)
def minus_click(e):
input.value = str(int(input.value) - 1)
def plus_click(e):
input.value = str(int(input.value) + 1)
page.add(
ft.Row(
alignment=ft.MainAxisAlignment.CENTER,
controls=[
ft.IconButton(ft.Icons.REMOVE, on_click=minus_click),
input,
ft.IconButton(ft.Icons.ADD, on_click=plus_click),
],
)
)
ft.run(main)
Hey, so i have been having this issue too, for me 0.80.3 and above just do not load the controls. As shown in your screenshot.
it's work with me
I use flet==0.80.5 And Python3.14.2
PlotlyChart Examples do not work, either. Windows 11 Python 3.14 Flet 0.80.5
@gsal Try this it's work
import plotly.express as px
from flet import Image,Page,run
data_canada = px.data.gapminder().query("country == 'Canada'")
fig = px.bar(data_canada, x='year', y='pop')
result = fig.to_image()
def main(page:Page):
page.add(
Image(
src=result
)
)
page.update()
run(main)
@mostafa-kessassi : the line result = fig.to_image() never returns.
It works on my end (v0.80.5 - macOS 15):
Wll suggest you create a new venv and retry, as the issue you have seems specific to you.
@gsal for me it's work try install last version of all
pip install kaleido==1.2.0 plotly==6.5.2
@mostafa-kessassi : right, that's what I have....I just installed in the last couple of days, as I wanted to include my first graph in my first Flet app.
By the way, an example from the matplotlib works just fine.
In any case, here is part of my pyproject.toml, and the specs of my computer GPUs ....maybe the issue is GPU related?
dependencies = [
"flet-charts>=0.80.5",
"flet-datatable2>=0.80.5",
"kaleido>=1.2.0",
"lazy-loader>=0.4",
"matplotlib>=3.10.8",
"numpy>=2.4.2",
"pandas>=3.0.0",
"plotly>=6.5.2",
"pyyaml>=6.0.3",
"scipy>=1.17.0",
]
[dependency-groups]
dev = [
"flet-charts>=0.80.5",
"flet[all]>=0.80.5",
]
GPU 0
Intel(R) UHD Graphics
Driver version: 32.0.101.7077
Driver date: 9/16/2025
DirectX version: 12 (FL 12.1)
Physical location: PCI bus 0, device 2, function 0
Utilization 0%
Dedicated GPU memory 1.0/8.0 GB
Shared GPU memory 0.4/63.8 GB
GPU Memory 0.4/63.8 GB
GPU 1
NVIDIA RTX 2000 Ada Generation Laptop GPU
Driver version: 32.0.15.7371
Driver date: 8/21/2025
DirectX version: 12 (FL 12.1)
Physical location: PCI bus 1, device 0, function 0
Utilization 4%
Dedicated GPU memory 1.0/8.0 GB
Shared GPU memory 0.2/63.8 GB
GPU Memory 1.2/71.8 GB
It works on my end (v0.80.5 - macOS 15):
Wll suggest you create a new venv and retry, as the issue you have seems specific to you.
I create new venv but issue remains unresolved(v0.80.5 - macOS 15 - python 3.12)
Sorry, I guess it is my fault that we are talking about two different things, intertwined.
@zangxx66 : Hey, what's up with the 'sudo' thing? Will you start over without sudo? ...it is only a few lines:
mkdir singer
cd singer
uv init
uv add "flet[all]>=0.80.5"
cp ../main.py .
uv run main.py
Sorry, I guess it is my fault that we are talking about two different things, intertwined.
@zangxx66 : Hey, what's up with the 'sudo' thing? Will you start over without sudo? ...it is only a few lines:
mkdir singer cd singer uv init uv add "flet[all]>=0.80.5" cp ../main.py . uv run main.py
I can run the program normally by using view=ft.AppView.FLET_APP_WEB or view=ft.AppView.WEB_BROWSER, but others will show "working". Maybe I have some uninstalled dependencies.
First, a rhetorical question: what version of Python are you using?
Now, the question I actually mean to ask: Do you have a like a normal, pre-installed version of Python that uv is finding and using.....or....is uv installing its own Python?
It may be a pain, but I would try a "proper" Python installation (over uv's ), I believe it may include libraries that have been stripped from what uv gets.
@gsal bro your pc are so great then what i have i think you build the app and after that you test it or you test it in vs code normaly
@zangxx66 it a file messing or somthing wrong in system files flet in 0.80.5 are great and work can you try delete python and install the new version and change the dir* of you project file to make it in smole path like paste in in desktop folder
@zangxx66 if you still face an issue concerning this, you can ping me on Flet discord server, and we could join a voice-channel to try understanding this better.
Will close this ticket for now, if you don't mind.
Wll suggest you create a new venv and retry, as the issue you have seems specific to you.