question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: libgpiod.so.2: cannot open shared object file: No such file or directory

See original GitHub issue

Hi,

I’m running the example as demonstrated here: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup#

I was using the deprecated library (https://github.com/adafruit/Adafruit_Python_DHT) initially with the exact same setup and it is working. So I’m certain the sensor is working.

I have updated my script to import the new library, made some changes as per example but when I’m running the script I get the following error.

I’m fairly new to python, so any help would be welcome to resolve this.

PS. GPIO_PIN_NR is declared as GPIO_PIN_NR = board.D4 because I have connected the data wire of the DHT11 sensor to GPIO pin 4.

Console output:

(.env) pi@raspberrypi:~/dht-sensor-reader $ python3 temp.py
/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein: error while loading shared libraries: libgpiod.so.2: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "temp.py", line 19, in <module>
    dhtSensor = adafruit_dht.DHT11(GPIO_PIN_NR)
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_dht.py", line 246, in __init__
    super().__init__(True, pin, 18000)
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_dht.py", line 66, in __init__
    self.pulse_in = PulseIn(self._pin, 81, True)
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 64, in __init__
    message = self._wait_receive_msg()
  File "/home/pi/dht-sensor-service/.env/lib/python3.7/site-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 80, in _wait_receive_msg
    raise RuntimeError("Timed out waiting for PulseIn message")
RuntimeError: Timed out waiting for PulseIn message

The full script can be found here: https://gitlab.com/dht-sensor/dht-sensor-reader/blob/feature/adafruit_lib/temp.py The DHT11 is instantiated at line 19. The values are read at 62,63

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
ladyadacommented, Dec 11, 2019

run sudo apt-get install libgpiod2

2reactions
zom-procommented, Dec 31, 2019

I can’t find that library in my raspbian installation. I have run update, upgrade, dist-upgrade but can’t find it.

$ sudo apt install libgpiod2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libgpiod2

my OS version

Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 9.11 (stretch)
Release:	9.11
Codename:	stretch

When I try to search for it, I get nothing. When I search for

$  apt-cache search libgpiod
gpiod - Tools for interacting with Linux GPIO character device - binary
libgpiod-dev - C library for interacting with Linux GPIO device - static libraries and headers
libgpiod-doc - C library for interacting with Linux GPIO device - library documentation
libgpiod1 - C library for interacting with Linux GPIO device - shared libraries
libgpiod1-dbgsym - Debug symbols for libgpiod1

What am I missing? can I install it from another source?

Read more comments on GitHub >

github_iconTop Results From Across the Web

error while loading shared libraries: libgpiod.so.2:cannot open ...
I'm having the error saying error while loading shared libraries: ... libgpiod.so.2: cannot open shared object file: No such file or ...
Read more >
Imx7: error while loading shared libraries: libgpiod.so.2 ...
Imx7: error while loading shared libraries: libgpiod.so.2: cannot open shared object file: No such file or directory · Technical Support.
Read more >
libgpiod API usage (Linux shared libraries) - Stack Overflow
That compiled. But when I run, I am told cannot open shared object file: No such file or directory ... – Bastinoboy.
Read more >
[Solved] cannot open shared object file Error in Ubuntu
The full error generally looks like this: error while loading shared libraries: cannot open shared object file: No such file or directory.
Read more >
CircuitPython Libraries on Linux and Google Coral
Getting an error message about "board" not found or "board" has no attribute ... libgpiod.so.2: cannot open shared object file: No such file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found