安装开发版本¶
安装 Flower 的开发版本¶
使用诗歌(推荐)¶
Install a flwr pre-release from PyPI: update the flwr dependency in
pyproject.toml and then reinstall (ensure to delete poetry.lock via rm
poetry.lock before running python -m poetry install).
flwr = { version = "1.0.0a0", allow-prereleases = true }(不含额外内容)flwr = { version = "1.0.0a0", allow-prereleases = true, extras = ["simulation"] }(包含额外内容)
通过 pyproject.toml 从 Flower 源代码的本地副本安装 flwr:
flwr = { path = "../../", develop = true }(不含额外内容)flwr = { path = "../../", develop = true, extras = ["simulation"] }(包含额外内容)
通过 pyproject.toml 从本地轮子文件安装 flwr:
flwr = { path = "../../dist/flwr-1.8.0-py3-none-any.whl" }(without extras)flwr = { path = "../../dist/flwr-1.8.0-py3-none-any.whl", extras = ["simulation"] }(with extras)
有关详细信息,请参阅 Poetry 文档: 诗歌依赖性规范 <https://python-poetry.org/docs/dependency-specification/>`_
使用 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)