Installing FedML

FedML supports Linux, MacOS, Windows, and Android.

FedML Source Code Repository

Installing with pip

pip install fedml

The default machine learning engine is PyTorch. FedML also supports TensorFlow, Jax, and MXNet. You can install related engine as follows:

pip install "fedml[tensorflow]"
pip install "fedml[jax]"
pip install "fedml[mxnet]"

The above commands work properly in Linux environment. For Windows/Mac OS (Intel)/Mac OS (M1), you may need to follow TensorFlow/Jax/MXNet official guidance to fix related installation issues.

Installing FedML with Anaconda

conda create --name fedml python
conda activate fedml
conda install --name fedml pip
pip install fedml

(Note: please use python 3.7 if you met any compatability issues. We will support 3.8, 3.9, 3.10 systematically in the next iteration.)

After installation, please use “pip list | grep fedml” to check whether fedml is installed.

Installing FedML from Debugging and Editable Mode

cd python
pip install -e ./

Installing FedML from Source

git clone && \
cd ./FedML/python && \
python install

If you want to run examples with tensforflow, jax or mxnet, you need to install optional dependencies:

git clone && \
cd ./FedML/python && \
python install -e '.[tensorflow]'
python install -e '.[jax]'
python install -e '.[mxnet]'

(Notes: Tensorflow example located in tf_mqtt_s3_fedavg_mnist_lr_example directory, Jax example location in jax_haiku_mqtt_s3_fedavg_mnist_lr_example directory)

If you need to install from a specific commit (normally used for the debugging/development phase), please follow commands below:

git clone && \
cd ./FedML && git checkout e798061d62560b03e049d514e7cc8f1a753fde6b && \
cd python && \
python install

Please change the above commit id to your own (you can find it at

Guidance for Windows Users

Please follow instructions at Windows Installation

Guidance for Raspberry Pi Users

Please follow instructions at Raspberry Pi Installation

Guidance for NVIDIA Jetson Devices

Please follow instructions at NVIDIA Jetson Device Installation

Testing if the installation succeeded

If the installation is successful, you will not see any issue when run import fedml.

(mnn37) chaoyanghe@Chaoyangs-MBP FedML-refactor % python
Python 3.7.7 (default, Mar 26 2020, 10:32:53) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fedml

Installing FedML Android SDK/APP

Please follow the instructions at


If you met any issues during installation or have additional installation requirements, please post issues at