Skip to main content

System requirements

Before installing Syft-Flwr, ensure your system meets these requirements:
  • Python: 3.12 or higher (< 3.14)
  • Operating System: Linux, macOS, or Windows
  • Package Manager: pip or uv (recommended)
For Google Colab, all dependencies are pre-installed. You only need to install Syft-Flwr.

Installation methods

Dependencies

Syft-Flwr automatically installs these core dependencies:
  • flwr[simulation]==1.25.0 - Flower federated learning framework
  • flwr-datasets[vision]>=0.5.0 - Federated datasets
  • syft-rds>=0.5.0 - Remote data science runtime
  • syft-client>=0.1.94 - Syft client for data governance
  • syft-dataset>=0.1.5 - Dataset management
  • syft-job>=0.1.23 - Job orchestration
  • loguru>=0.7.3 - Logging
  • safetensors>=0.7.0 - Model serialization
  • huggingface-hub>=0.26.0 - Dataset downloads
  • tomli>=2.3.0 - TOML parsing
  • typing-extensions>=4.13.0 - Type hints

Optional dependencies

For ML model training, you’ll need additional packages:
pip install torch>=2.0.0
The quickstart examples use PyTorch for model training. Install it before running those examples.

Verify installation

Run this Python script to verify everything is installed correctly:
import syft_flwr
import syft_client as sc
import flwr

print(f"Syft-Flwr version: {syft_flwr.__version__}")
print(f"Syft-Client version: {sc.__version__}")
print(f"Flower version: {flwr.__version__}")

# Test bootstrap function
from syft_flwr import bootstrap
print("✅ All imports successful!")
Expected output:
Syft-Flwr version: 0.5.0
Syft-Client version: 0.1.94
Flower version: 1.25.0
✅ All imports successful!

Environment setup

For local development

If running locally with SyftBox:
1

Install SyftBox

Follow the SyftBox installation guide to set up the local sync daemon.
2

Set environment variables

export SYFTBOX_EMAIL="your-email@example.com"
export SYFTBOX_FOLDER="$HOME/.syftbox"
3

Verify SyftBox is running

# Check SyftBox status
syftbox status

For Google Colab

No additional setup required! Syft-Flwr auto-detects Colab and uses P2P transport (Google Drive) instead of SyftBox.

For development

Install additional development tools:
# Install just (command runner)
brew install just  # macOS
cargo install just  # Rust

# Install pre-commit hooks
uv run pre-commit install

# Install ruff (linter/formatter)
uv pip install ruff

Platform-specific notes

Apple Silicon (M1/M2/M3)PyTorch automatically detects Metal Performance Shaders (MPS) for GPU acceleration:
import torch
print(torch.backends.mps.is_available())  # Should return True
Intel-based MacsUse CPU or install with CUDA if you have an eGPU.
Activate virtual environment
.venv\Scripts\activate
Path issuesUse raw strings for paths:
from pathlib import Path
project_path = Path(r"C:\Users\Name\fl-project")
Long pathsEnable long path support: Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths
GPU supportFor CUDA-enabled GPUs:
# Check CUDA version
nvidia-smi

# Install PyTorch with CUDA
pip install torch --index-url https://download.pytorch.org/whl/cu118
File permissionsEnsure your user has read/write access to the SyftBox folder:
chmod -R 755 ~/.syftbox

Troubleshooting

Error: ModuleNotFoundError: No module named 'syft_flwr'Solution:
# Verify installation
pip list | grep syft-flwr

# Reinstall if missing
pip install --force-reinstall syft-flwr
Error: ERROR: pip's dependency resolver does not currently take into account...Solution:
# Use uv (faster dependency resolution)
pip install uv
uv pip install syft-flwr

# Or upgrade pip
pip install --upgrade pip
Error: Requires-Python >=3.12,<3.14Solution:
# Check Python version
python --version

# Use pyenv to install correct version
pyenv install 3.12
pyenv local 3.12
Error: AttributeError: module 'flwr' has no attribute 'simulation'Solution:
# Reinstall with simulation support
pip install "flwr[simulation]==1.25.0"

Upgrading

To upgrade to the latest version:
pip install --upgrade syft-flwr

Uninstalling

To completely remove Syft-Flwr:
pip uninstall syft-flwr

# Also remove dependencies if no longer needed
pip uninstall syft-client syft-rds syft-dataset syft-job flwr flwr-datasets

Next steps

Quickstart

Train your first federated model in 5 minutes

Development guide

Set up your development environment

API reference

Explore the complete API

Examples

Learn from real-world examples

Get help

If you encounter issues:

Build docs developers (and LLMs) love