It is recommended to run your Python setup within a virtual environment. This guide shows three different examples how to create a virtual environment with pyenv virtualenv, poetry, or Anaconda. You can follow the instructions or choose your preferred setup.
Flower requires at least Python 3.10.
Note
Due to a known incompatibility with ray, we currently recommend utilizing at most Python 3.11 for running Flower simulations.
One of the recommended virtual environment is pyenv/virtualenv. Please see Flower examples for details.
Once Pyenv is set up, you can use it to install Python Version 3.10 or above:
pyenv install 3.10.19Create the virtualenv with:
pyenv virtualenv 3.10.19 flower-3.10.19Activate the virtualenv by running the following command:
echo flower-3.10.19 > .python-versionThe Flower examples are based on Poetry to manage dependencies. After installing Poetry you simply create a virtual environment with:
poetry installIf you open a new terminal you can activate the previously created virtual environment with the following command:
eval "$(poetry env activate)"If you prefer to use Anaconda for your virtual environment then install and setup the conda package. After setting it up you can create a virtual environment with:
conda create -n flower-3.10.19 python=3.10.19and activate the virtual environment with:
conda activate flower-3.10.19