Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1251

Python • ImportError: libgpiod Python bindings not found

$
0
0
I created a virtual environment in raspberry pi 5 to handle servo motors with a servo driver hat B, and installed adafruit_blinka and manually installed libgpiod with sudo apt install -y python3-libgpiod because of an error but now i am getting this error below

(venv) pi@raspberrypi:~/Desktop/Codes/servo_env $ python3 servo_test.py
ImportError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/pi/Desktop/Codes/servo_env/servo_test.py", line 2, in <module>
import board
File "/home/pi/Desktop/Codes/servo_env/venv/lib/python3.11/site-packages/board.py", line 50, in <module>
from adafruit_blinka.board.raspberrypi.raspi_5b import *
File "/home/pi/Desktop/Codes/servo_env/venv/lib/python3.11/site-packages/adafruit_blinka/board/raspberrypi/raspi_5b.py", line 6, in <module>
from adafruit_blinka.microcontroller.bcm2712 import pin
File "/home/pi/Desktop/Codes/servo_env/venv/lib/python3.11/site-packages/adafruit_blinka/microcontroller/bcm2712/pin.py", line 5, in <module>
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
File "/home/pi/Desktop/Codes/servo_env/venv/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 8, in <module>
raise ImportError(
ImportError: libgpiod Python bindings not found, please install and try again! See https://github.com/adafruit/Raspberry-P ... ibgpiod.py

i tried various commands like pip3 install --force-reinstall adafruit-blinka libgpiod
sudo apt-get install -y libgpiod2 libgpiod-dev
but still getting same error
script is running good in RPi 3 but error in Pi5

Statistics: Posted by Rikey44 — Sat May 18, 2024 4:53 pm



Viewing all articles
Browse latest Browse all 1251

Trending Articles