ballle98 / cec-mqtt-bridge

A HDMI-CEC to MQTT bridge for connecting HDMI-CEC-devices to your Home Automation system.
2 stars 1 forks source link

dist-packages/lirc/client.py - No module named '_client' #18

Open ballle98 opened 1 week ago

ballle98 commented 1 week ago

Seeing this issue with lirc python module

python3 -c "import lirc"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lirc/__init__.py", line 7, in <module>
    from .client import get_default_lircrc_path
  File "/usr/lib/python3/dist-packages/lirc/client.py", line 38, in <module>
    import _client
ModuleNotFoundError: No module named '_client'
ballle98 commented 1 week ago

This was probably messed up by pip install lirc

to clean up make sure there is no lirc showing up in "pip3 list | grep lirc" if there is uninstall it

clean it up with "sudo apt-get install --reinstall lirc"

ballle98 commented 1 week ago

ugh this seems to happen when running as root :(

openhabian@openhabian:~/git/cec-mqtt-bridge/src $ python3 -c "import lirc"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lirc/__init__.py", line 7, in <module>
    from .client import get_default_lircrc_path
  File "/usr/lib/python3/dist-packages/lirc/client.py", line 38, in <module>
    import _client
ModuleNotFoundError: No module named '_client'
openhabian@openhabian:~/git/cec-mqtt-bridge/src $ sudo apt-get install --reinstall lirc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 13 not upgraded.
Need to get 0 B/509 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 120380 files and directories currently installed.)
Preparing to unpack .../lirc_0.10.1-6.3_arm64.deb ...
Unpacking lirc (0.10.1-6.3) over (0.10.1-6.3) ...
Setting up lirc (0.10.1-6.3) ...
Processing triggers for man-db (2.9.4-2) ...
Updating FireMotD available updates count ...
openhabian@openhabian:~/git/cec-mqtt-bridge/src $ python3 -c "import lirc"
openhabian@openhabian:~/git/cec-mqtt-bridge/src $ python3 -c "import lirc"
openhabian@openhabian:~/git/cec-mqtt-bridge/src $ sudo python3 -c "import lirc"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lirc/__init__.py", line 7, in <module>
    from .client import get_default_lircrc_path
  File "/usr/lib/python3/dist-packages/lirc/client.py", line 38, in <module>
    import _client
ModuleNotFoundError: No module named '_client'
ballle98 commented 1 week ago

same issue on Ubuntu 22.04.5 and Raspbain 11 bullseye