Registry / web-framework / flet
library0.85.3pypypi✓ verified 86d ago

Flet is a Python framework that enables developers to build interactive, real-time, multi-platform applications using a simple Python API. It renders UI using Flutter, allowing apps to run as web apps, desktop executables, or mobile apps from the same codebase. The current version is 0.84.0, and it maintains an active and frequent release cadence, often with bi-weekly updates.

pip install flet
INSTALL
IMPORT
SIG · FLET
F
flet
web-frameworkpythonv0.85.3
Install
2.7s avg
Import
2132ms
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.85.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 2.249s · 29.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.7s · import 2.015s · 30MB
28MB installed
● package 28MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

flet
import flet as ft
import flet_web
The primary package is 'flet', not 'flet_web'.
Page
page: ft.Page
Type hint for the Page object passed to the main function.

This quickstart demonstrates a simple counter application. It initializes a Flet page, creates a text field and two buttons, and defines event handlers to increment or decrement the counter. The `ft.app(target=main)` call runs the application, typically opening a desktop window by default.

import flet as ft def main(page: ft.Page): page.title = "Flet Counter" 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.MainAxisAlignment.CENTER, ) ) ft.app(target=main)
flet --version
Debug
Known issues
breakingThe `delta_x` and `delta_y` attributes on `PointerEvent` objects have been deprecated and removed. Using them will result in an `AttributeError`.
fix
Replace `event.delta_x` with `event.local_delta.x` and `event.delta_y` with `event.local_delta.y`.
affects: >=0.83.1
gotchaThe correct PyPI package name for Flet is `flet`, not `flet-web`. Although Flet supports web deployment, attempting to `pip install flet-web` or `import flet_web` will lead to installation issues or `ModuleNotFoundError`.
fix
Always use `pip install flet` and `import flet as ft`.
affects: All versions
gotchaTo deploy or run a Flet application specifically as a web app, you need to configure the view and potentially use CLI commands. Simply running a Python script will often default to a desktop application.
fix
Use `ft.app(target=main, view=ft.WEB_BROWSER)` for web browser mode. For deployment, consider `flet run` or `flet publish` CLI commands.
affects: All versions
gotchaThe `page.add()` method expects a single control argument. A common mistake for new users is to pass multiple controls as separate arguments directly to `page.add()`.
fix
To add multiple controls, wrap them in a layout control such as `ft.Row`, `ft.Column`, or `ft.Stack`, and then add that single layout control to the page: `page.add(ft.Column([control1, control2]))`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'flet_web'
Attempting to import `flet_web` or install a non-existent package `flet-web` instead of the correct `flet` package.
fix
Install with `pip install flet` and import with `import flet as ft`.
TypeError: Page.add() takes 1 positional argument but 2 were given
Trying to add multiple controls directly to `page.add()` as separate arguments.
fix
Wrap multiple controls in a layout container (e.g., `ft.Row`, `ft.Column`) and pass the container as a single argument to `page.add()`. Example: `page.add(ft.Column([control1, control2]))`.
WebSocket connection to 'ws://localhost:8550/ws' failed:
The Flet Python backend server is not running, or the specified port is blocked/already in use, preventing the client (browser or desktop app) from connecting.
fix
Ensure your Flet Python script is actively running. If the port is an issue, try running `ft.app(target=main, port=8551)` to use a different port, or check firewall settings.
NameError: name 'ft' is not defined
Forgetting to import `flet` or aliasing it as `ft` at the beginning of the script.
fix
Add `import flet as ft` at the top of your Flet application script.
Upgrade
Version history
0.85.3latest on PyPI · released Jun 8, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Resources
flet — pip install flet · libregistry