安装Flower#
Python 版本#
Flower 至少需要 Python 3.8,但建议使用 `Python 3.10 <https://docs.python.org/3.10/>`_或更高版本。
安装稳定版#
Using pip#
稳定版本可在 PyPI::
python -m pip install flwr
对于使用虚拟客户端引擎的模拟,flwr` 应与`simulation`` 一起安装:
python -m pip install flwr[simulation]
Using conda (or mamba)#
Flower can also be installed from the conda-forge
channel.
If you have not added conda-forge
to your channels, you will first need to run the following:
conda config --add channels conda-forge
conda config --set channel_priority strict
Once the conda-forge
channel has been enabled, flwr
can be installed with conda
:
conda install flwr
or with mamba
:
mamba install flwr
验证安装#
The following command can be used to verify if Flower was successfully installed. If everything worked, it should print the version of Flower to the command line:
python -c "import flwr;print(flwr.__version__)"
1.8.0
高级安装选项#
Install via Docker#
安装预发布版本#
在稳定版发布之前,Flower 的新版本(可能是不稳定版)有时会作为预发布版本(alpha、beta、候选发布版本)提供::
python -m pip install -U --pre flwr
对于使用虚拟客户端引擎的模拟,`flwr``预发行版应与`simulation``一起安装:
python -m pip install -U --pre flwr[simulation]
安装隔夜版本#
Flower 中最新(可能不稳定)的更改以隔夜发布的形式提供::
python -m pip install -U flwr-nightly
对于使用虚拟客户端引擎的模拟,`flwr-nightly`应与`simulation`一起安装:
python -m pip install -U flwr-nightly[simulation]