安装开发版本¶
安装 Flower 的开发版本¶
Using uv (recommended)¶
Install a flwr pre-release from PyPI with uv add, which updates
pyproject.toml and syncs the environment:
uv add --prerelease=allow "flwr==1.0.0a0"(without extras)uv add --prerelease=allow "flwr[simulation]==1.0.0a0"(with extras)
Install flwr from a local copy of the Flower source code:
uv add --editable "../../"(without extras)uv add --editable "../../" --extra simulation(with extras)
Install flwr from a local wheel file:
uv add "../../dist/flwr-1.8.0-py3-none-any.whl"(without extras)uv add "../../dist/flwr-1.8.0-py3-none-any.whl" --extra simulation(with extras)
Please refer to the uv documentation for further details: Managing dependencies with uv
使用 pip(建议在 Colab 上使用)¶
从 PyPI 安装 flwr 预发行版:
Python 软件包可以从 git 仓库安装。使用以下命令之一直接从 GitHub 安装 Flower。
从 GitHub 的默认分支 (main`) 安装 ``flwr:
pip install flwr@git+https://github.com/flwrlabs/flower.git#subdirectory=framework(without extras)pip install 'flwr[simulation]@git+https://github.com/flwrlabs/flower.git#subdirectory=framework'(with extras)
从特定的 GitHub 分支 (分支名) 安装 flwr:
pip install flwr@git+https://github.com/flwrlabs/flower.git@branch-name#subdirectory=framework(without extras)pip install 'flwr[simulation]@git+https://github.com/flwrlabs/flower.git@branch-name#subdirectory=framework'(with extras)