Virtual Env Installation

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.

Python Version

Flower requires Python 3.6 or above, we recommend Python 3.7.

Virutualenv with Pyenv/Virtualenv

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.6 or above:

pyenv install 3.7.9

Create the virtualenv with:

pyenv virtualenv 3.7.9 ml-federated-3.7.9

Activate the virtualenv by running the following command:

echo ml-federated-3.7.9 > .python-version

Virtualenv with Poetry

The Flower examples are based on Poetry to manage dependencies. After installing Poetry you simply create a virtual environment with:

poetry shell

If you open a new terminal you can activate the previously created virtual environment with the following command:

source $(poetry env info --path)/bin/activate

Virtualenv with Anaconda

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 ml-federated-3.7.9 python=3.7.9

and activate the virtual environment with:

conda activate ml-federated-3.7.9

And then?

As soon as you created your virtual environment you clone one of the Flower examples.