TensorFlow Federated Environment

Hello guys!
I’m trying to riproduce the same TensorFlow Federated Environment in all my machines using Docker. Would be nice to install TensorFlow Federated starting from the TensorFlow Docker image.
The problem Is that If you try to install TensorFlow Federated insider a Docker container based on TensorFlow Docker image It Will create a lot of problems due to compatibility between versions.
This happens either If you install using pip or if you install from source.
Do you know how to solve the issue or do you have a good Dockerfile and requirements.txt with all the correct and updated dependencies to reach the goal I’m searching for?
Ty in Advance.


Welcome to the Tensorflow Forum!

Could you please share complete error log to investigate the issues reported here?

Thank you!

When I try to install Tensorflow federated from source inside a docker container created from the offical Tensorflow docker image, without creating a venv because I’m already in a docker container, I receive the following error:
/tmp/tmp.JugxMpmXa1 ~/.cache/bazel/_bazel_root/13f956c768d751b1bc658674921e5be9/execroot/org_tensorflow_federated/bazel-out/k8-opt/bin/tensorflow_federated/tools/python_package/build_python_package.runfiles/org_tensorflow_federated
/root/.cache/bazel/_bazel_root/13f956c768d751b1bc658674921e5be9/execroot/org_tensorflow_federated/bazel-out/k8-opt/bin/tensorflow_federated/tools/python_package/build_python_package: line 70: python3.10: command not found

If with the same setup I install phyton 3.10 before starting the build with bazel I receive instead the following error:
INFO: Analyzed target //tensorflow_federated/tools/python_package:build_python_package (0 packages loaded, 0 targets configured).
INFO: Found 1 target…
Target //tensorflow_federated/tools/python_package:build_python_package up-to-date:
INFO: Elapsed time: 4052.405s, Critical Path: 262.88s
INFO: 2769 processes: 1 internal, 2768 local.
INFO: Build completed successfully, 2769 total actions
INFO: Running command line: bazel-bin/tensorflow_federated/tools/python_package/build_pyINFO: Build completed successfully, 2769 total actions
error: unrecognized option ’ --output_dir=/tmp/tensorflow_federated’
usage: build_python_package --python=python3.10 --output_dir=
–python=python3.10 The Python version used by the environment to
build the Python package.
–output_dir= An output directory.


line 70: python3.10: command not found

It indicates that the build script is unable to find Python 3.10 on your system. You will need to install Python 3.10 and make sure it is added to your PATH environment variable before attempting to run the build script again.

error: unrecognized option ’ --output_dir=/tmp/tensorflow_federated’

Can you try running the command as shown below

build_python_package --python=python3.10 --output_dir=/tmp/tensorflow_federated

Thank you!