Skip to content

module 'gpiod' has no attribute 'Line'. Did you mean: 'line'? #69

@raboof

Description

@raboof

On NixOS, there seems to be a mismatch between RPi.GPIO2 and the gpiod bindings. I'm not yet sure whether this is an upstream issue or an issue in the NixOS packaging, but I thought I'd mention it here at least ;)

>>> from RPi import GPIO
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/vdfycwbxj5704a2s6mcfg94f73wpqgjj-python3-3.11.5-env/lib/python3.11/site-packages/RPi/GPIO/__init__.py", line 8, in <module>
    from RPi.core import\
  File "/nix/store/vdfycwbxj5704a2s6mcfg94f73wpqgjj-python3-3.11.5-env/lib/python3.11/site-packages/RPi/core.py", line 59, in <module>
    LOW  = gpiod.Line.ACTIVE_LOW
           ^^^^^^^^^^
AttributeError: module 'gpiod' has no attribute 'Line'. Did you mean: 'line'?

NixOS/nixpkgs#263759

Looks like the API just completely changed between libgpiod 1.x and 2.x

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