Set up a virtual env#

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.7 or above, we recommend Python 3.8.

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

pyenv install 3.7.13

Create the virtualenv with:

pyenv virtualenv 3.7.13 flower-3.7.13

Activate the virtualenv by running the following command:

echo flower-3.7.13 > .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 flower-3.7.13 python=3.7.13

and activate the virtual environment with:

conda activate flower-3.7.13

And then?#

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