Installation with pip

To install TensorFlow Decision Forests, run:

pip3 install tensorflow_decision_forests --upgrade

Then, check the installation with:

python3 -c "import tensorflow_decision_forests as tfdf; print('Found TF-DF v' + tfdf.__version__)"

Build from source


  • Microsoft Visual Studio >= 2019 (Windows) or GCC>=7.3 (Linux).
  • Bazel >= 3.7.2
  • Python >= 3
  • Git
  • Python's numpy
  • MSYS2 (Windows only)

Download and compile TensorFlow Decision Forests as follow:

# Download the source code of TF-DF.
git clone
cd decision-forests

# Download TensorFlow's BazelRC.
# See "tensorflow_bazelrc" for the compilation options.
# Note: If you compile with an older version of TensorFlow, download the
# corresponding bazelrc.

# Compile TensorFlow Decision Forests.
bazel-3.7.2 --bazelrc=${TENSORFLOW_BAZELRC} build //tensorflow_decision_forests/...:all --config=linux

# Create a pip package.
./tools/ simple

# Install the pip package
pip3 install dist/*.whl