Skip to content

Latest commit

 

History

History
157 lines (116 loc) · 3.98 KB

File metadata and controls

157 lines (116 loc) · 3.98 KB
title Installation

import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs';

Prerequisites

Python version

Flet requires Python 3.10 or later. (1)

  1. Check your Python version using python --version.

Operating System

macOS

Flet supports macOS 12 (Monterey) or later.

Windows

Flet supports 64-bit version of Microsoft Windows 10 and Windows 11.

Linux

Flet supports Debian 10, 11 and 12 and Ubuntu 20.04, 22.04 and 24.04 LTS.

Desktop flavor (audio & video support)

On Linux, the Flet desktop client is available in two flavors: full and light.

The light flavor (default on Linux) does not include audio and video extensions, resulting in a smaller download. The full flavor bundles audio and video support out of the box.

To select the flavor, either set the FLET_DESKTOP_FLAVOR environment variable:

export FLET_DESKTOP_FLAVOR=full

or add the setting to your project's pyproject.toml:

[tool.flet]
desktop_flavor = "full"

If you use the light flavor and need audio or video, you will need to install the required libraries yourself — see the Audio and Video setup guides.

Windows Subsystem for Linux (WSL)

Flet apps can be run on WSL 2 (Windows Subsystem for Linux 2).

However, if you are getting cannot open display error follow this guide for troubleshooting.

Creating a virtual environment (venv)

We recommend using a virtual environment for your Flet projects to keep dependencies isolated and avoid conflicts with your other Python projects.

First, create a new directory for your Flet project and switch into it:

mkdir my-app
cd my-app

Next, create and activate a virtual environment (we recommend using uv as package manager):

[**uv**](https://docs.astral.sh/uv/) is "An extremely fast Python package and project manager, written in Rust".

Install uv if you haven't already, then run the following commands:

uv init --python='>=3.10'
uv venv
source .venv/bin/activate # (1)!
  1. If you are on Windows, use .venv\Scripts\activate instead.
Using Python's built-in [`venv`](https://docs.python.org/3/library/venv.html) module: ```bash python -m venv .venv # (1)! source .venv/bin/activate # (2)! ```
  1. On Unix-like systems (Linux, macOS), use python3 -m venv .venv if python points to Python 2.x.
  2. If you are on Windows, use .venv\Scripts\activate instead.
## Install Flet

To install Flet and add it to your project dependencies, do the following depending on your package manager:

```bash uv add 'flet[all]' ``` ```bash pip install 'flet[all]' # (1)! ```
  1. After this, you will have to manually add this package to your requirements.txt or pyproject.toml.
## Verify installation

To make sure Flet has been installed correctly, we can check its version using the --version (or -V) flag or the doctor command:

```bash uv run flet --version # or uv run flet doctor ``` ```bash flet --version # or flet doctor ``` Now you are ready to [create your first Flet app](create-flet-app.md).

Upgrade Flet

To upgrade Flet to its latest version:

```bash uv add 'flet[all]' --upgrade ``` ```bash pip install 'flet[all]' --upgrade ```