Skip to main content

Installation

This guide will help you install SiFi Bridge Python and its dependencies on your system.

Requirements

  • Python: 3.9 - 3.12
  • Operating System: Linux, macOS, or Windows
  • Bluetooth Low Energy (BLE): 4.2+ for Data Length Extension and 5.0+ for PHY 2M are highly recommended

Standard Installation

Install SiFi Bridge Python using pip:

pip install sifi-bridge-py

This will install:

  • The sifi-bridge-py Python package
  • Core dependencies: numpy, requests, semantic-version

What Gets Installed

When you first import and use sifi_bridge_py, it will automatically:

  1. Check for a compatible sifibridge CLI executable
  2. Download the correct version if not found or incompatible
  3. Place the executable in your current working directory
info

The wrapper automatically manages CLI versions. Major and minor versions are kept in sync with the CLI, while patch versions vary for Python-specific fixes.

Installation with Examples

If you want to run the example scripts, install with optional dependencies:

pip install sifi-bridge-py[examples]

This includes additional packages:

  • matplotlib - For plotting and visualization
  • pylsl - For Lab Streaming Layer support
  • PySide6 - For GUI examples
  • pyqtgraph - For real-time plotting

Development Installation

For local development or to use the latest unreleased version:

git clone https://github.com/SiFiLabs/sifi-bridge-py.git
cd sifi-bridge-py
pip install -e .

The -e flag installs in "editable" mode, so changes to the source code are immediately reflected.

Verifying Installation

Test your installation:

import sifi_bridge_py as sbp

# This will download sifibridge if needed
sb = sbp.SifiBridge()
print("Installation successful!")

You can also check the installed version:

pip show sifi-bridge-py

Platform-Specific Notes

Linux

Ensure you have Bluetooth permissions:

# Add your user to the bluetooth group
sudo usermod -aG bluetooth $USER

# You may need to reboot for changes to take effect

macOS

macOS Bluetooth should work out of the box. Grant Bluetooth permissions when prompted.

Windows

Windows requires Bluetooth adapter drivers. Most modern laptops have Bluetooth support built-in.

Troubleshooting

Import Error

If you get an import error:

# Ensure pip is installing to the correct Python version
python3 -m pip install sifi-bridge-py

# Or use a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install sifi-bridge-py

Bluetooth Issues

If devices aren't discoverable:

  • Ensure Bluetooth is enabled on your system
  • Check that your device is powered on and in range
  • On Linux, verify Bluetooth service is running: systemctl status bluetooth

Version Conflicts

If you encounter version conflicts with the CLI:

# Force re-download of the CLI executable
import os
os.remove("./sifibridge") # Remove existing executable

# Next import will download the correct version
import sifi_bridge_py as sbp

Virtual Environments

We recommend using virtual environments to isolate project dependencies:

# Create virtual environment
python3 -m venv sifi-env

# Activate (Linux/macOS)
source sifi-env/bin/activate

# Activate (Windows)
sifi-env\Scripts\activate

# Install package
pip install sifi-bridge-py