Skip to content

Commit 68068ab

Browse files
authored
Merge pull request #1108 from makermelissa-piclaw/add-lgpio-install-guidance
Add helpful message when lgpio is not installed on Raspberry Pi
2 parents 792baf1 + f560f6d commit 68068ab

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,20 @@
4444
or b"brcm,bcm2711" in compat
4545
or b"brcm,bcm2712" in compat
4646
):
47+
lgpio_req = "lgpio>=0.2.2.0"
48+
try:
49+
import lgpio
50+
except ImportError:
51+
print(
52+
"\n*** lgpio is not installed. On Raspberry Pi OS, install it with:\n"
53+
" sudo apt-get install -y python3-lgpio\n"
54+
" Then recreate your virtual environment with --system-site-packages\n"
55+
" or install the wheel from:\n"
56+
" https://github.com/adafruit/lgpio-python-wheels\n"
57+
)
4758
board_reqs = [
4859
"rpi_ws281x>=4.0.0",
49-
"lgpio>=0.2.2.0",
60+
lgpio_req,
5061
"RPi.GPIO",
5162
"Adafruit-Blinka-Raspberry-Pi5-Neopixel",
5263
]

0 commit comments

Comments
 (0)