Skip to content

FileNotFoundError: (...) /usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein #44

@rsnitsch

Description

@rsnitsch

I am running Ubuntu Server 20.04 LTS 64-bit on a Raspberry Pi 3 B. I have a DHT11 sensor module.

I am following the instructions from https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup but the code does not work for me.

I have successfully executed these commands beforehand:

sudo apt-get install libgpiod2
sudo pip3 install adafruit-circuitpython-dht

This is my code:

# ky015.py
import time
import board
import adafruit_dht

# Initial the dht device, with data pin connected to:
dhtDevice = adafruit_dht.DHT11(board.D3)

while True:
    try:
        # Print the values to the serial port
        temperature_c = dhtDevice.temperature
        temperature_f = temperature_c * (9 / 5) + 32
        humidity = dhtDevice.humidity
        print(
            "Temp: {:.1f} F / {:.1f} C    Humidity: {}% ".format(
                temperature_f, temperature_c, humidity
            )
        )

    except RuntimeError as error:
        # Errors happen fairly often, DHT's are hard to read, just keep going
        print(error.args[0])

    time.sleep(2.0)

This is the error I get:

ubuntu@ubuntu:~/ky015$ sudo python3 ky015.py
Traceback (most recent call last):
  File "ky015.py", line 6, in <module>
    dhtDevice = adafruit_dht.DHT11(board.D3)
  File "/usr/local/lib/python3.8/dist-packages/adafruit_dht.py", line 263, in __init__
    super().__init__(True, pin, 18000)
  File "/usr/local/lib/python3.8/dist-packages/adafruit_dht.py", line 69, in __init__
    self.pulse_in = PulseIn(self._pin, 81, True)
  File "/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/PulseIn.py", line 65, in __init__
    self._process = subprocess.Popen(cmd)
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein'

I have also followed the instructions for "Setup your Linux Board for using CircuitPython Libraries". The script blinkatest.py completes successfully (Link to code: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi#blinka-test-3-15). Output:

ubuntu@ubuntu:~/ky015$ sudo python3 blinkatest.py
Hello blinka!
Digital IO ok!
I2C ok!
SPI ok!
done!

The file libgpiod_pulsein does exist. The Python code seems to try and run it with subprocess.Popen. That's strange IMHO since the "lib" prefix does imply that it is a library, not an executable, right? On the other hand, a library should have a suffix of ".so". I am dumbfounded by that file name. By the way, this is ldd output for the file:

ubuntu@ubuntu:/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio$ ldd libgpiod_pulsein
        not a dynamic executable

This is the stat output:

ubuntu@ubuntu:/usr/local/lib/python3.8/dist-packages/adafruit_blinka/microcontroller/bcm283x/pulseio$ stat libgpiod_pulsein
  File: libgpiod_pulsein
  Size: 19752           Blocks: 40         IO Block: 4096   regular file
Device: b302h/45826d    Inode: 391704      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (   50/   staff)
Access: 2020-05-05 10:00:24.194643069 +0000
Modify: 2020-05-05 10:00:10.230685234 +0000
Change: 2020-05-05 10:00:10.990682910 +0000
 Birth: -

I have tried to reinstall the packages, but it did not fix my problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions