If you've already set up a Python virtual environment, you can also install the stable library manually from PyPi:
pip install lsm303d
Otherwise our install script will set one up for you.
Stable library from GitHub:
git clone https://github.com/pimoroni/lsm303d-python
cd lsm303d-python
./install.sh
Latest/development library from GitHub:
git clone https://github.com/pimoroni/lsm303d-python
cd lsm303d-python
./install.sh --unstable
Note Libraries will be installed in the "pimoroni" virtual environment, you will need to activate it to run examples: