Flet Installation Guide

Prerequisites

  • **Python Version:** Requires Python 3.10 or later.
  • **Operating System:**
  • * **macOS:** Supports macOS 11 (Big Sur) or later. * **Windows:** Supports 64-bit Windows 10 or later. * **Linux:** Supports Debian Linux 11 or later, and Ubuntu Linux 20.04 LTS or later. * **WSL:** Windows Subsystem for Linux 2 is supported. Refer to WSLg documentation for potential cannot open display issues.

    Virtual Environment Setup

    It is recommended to use a virtual environment for Flet projects.

    1. **Create Project Directory:**

        mkdir my-app
        cd my-app
        
    2. **Create and Activate Virtual Environment:** * **Using uv (Recommended):**
            uv init --python='>=3.10'
            uv venv
            source .venv/bin/activate
            
    * **Using Python's venv:**
            python -m venv .venv
            source .venv/bin/activate
            
    (On Windows, use .venv\Scripts\activate)

    Installing Flet

    Install Flet and add it to project dependencies:

  • **Using uv:**
  •     uv add 'flet[all]'
        
  • **Using pip:**
  •     pip install 'flet[all]'
        
    *Note: After using pip, manually add flet[all] to requirements.txt or pyproject.toml.

    Verifying Installation

    Check the installation using the --version flag or the doctor command:

  • **With uv:**
  •     uv run flet --version
        # or
        uv run flet doctor
        
  • **Directly:**
  •     flet --version
        # or
        flet doctor
        

    Upgrading Flet

    To upgrade Flet to the latest version:

  • **Using uv:**
  •     uv add 'flet[all]' --upgrade
        
  • **Using pip:**
  •     pip install 'flet[all]' --upgrade
        

    After successful installation, you are ready to [create your first Flet app](https://docs.flet.dev/getting-started/create-flet-app/).