Installation

This guide covers the installation of XClock and its prerequisites.

Prerequisites

System Requirements

  • Python: Version 3.12 or higher

  • Operating System: Windows, macOS, or Linux

  • DAQ Device Drivers: Device-specific software (see below)

DAQ Device Software

Before installing XClock, you need to install the software for your DAQ device.

LabJack T4/T7/T8

If you’re using a LabJack T-series device (T4, T7, or T8):

  1. Download and install the LabJack LJM (LabJack Modbus) software from the LabJack Downloads page

  2. Follow the installation instructions for your operating system

  3. Verify the installation by connecting your device and using the LabJack Kipling software (included with LJM)

Note

The LJM software includes drivers, example code, and the Kipling utility for testing your device.

Installing XClock

There are several methods to install XClock:

Method 2: Using pip

pip install git+https://github.com/brain-bremen/XClock.git

Method 3: Development Installation

If you want to contribute to XClock or modify the source code:

# Clone the repository
git clone https://github.com/brain-bremen/XClock.git
cd XClock

# Install in editable mode with development dependencies
uv sync --all-extras

# Or with pip
pip install -e ".[dev]"

Verifying Installation

After installation, verify that XClock is installed correctly:

Test Command-Line Tool

xclock --help

You should see the help message with available commands and options.

Test Python Import

from xclock.devices import LabJackT4

# This should work without errors
print("XClock imported successfully!")

Test Device Connection (Optional)

If you have a LabJack T4 connected:

from xclock.devices import LabJackT4

try:
    t4 = LabJackT4()
    print(f"Successfully connected to LabJack T4")
    print(f"Available channels: {t4.get_available_output_clock_channels()}")
    t4.close()
except Exception as e:
    print(f"Failed to connect: {e}")

Troubleshooting

Import Errors

Problem: ModuleNotFoundError: No module named 'xclock'

Solution: Make sure XClock is installed in your current Python environment. Check with:

pip list | grep XClock
# or
uv pip list | grep XClock

LabJack Connection Issues

Problem: Cannot connect to LabJack device

Solutions:

  1. Verify LJM software is installed correctly

  2. Check USB connection

  3. Test device with LabJack Kipling software

  4. On Linux, you may need to set up udev rules for USB access

  5. Try running with sudo/administrator privileges (temporarily, to diagnose)

Permission Issues on Linux

If you get permission errors when accessing the LabJack device on Linux:

  1. Create a udev rule for LabJack devices:

sudo nano /etc/udev/rules.d/99-labjack.rules
  1. Add the following line:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0cd5", MODE="0666"
  1. Reload udev rules:

sudo udevadm control --reload-rules
sudo udevadm trigger
  1. Reconnect your LabJack device

Next Steps