Domoticz/Docker paho module not found

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
boggiz
Posts: 46
Joined: Thursday 07 March 2019 11:40
Target OS: NAS (Synology & others)
Domoticz version: 2024.4
Location: France
Contact:

Domoticz/Docker paho module not found

Post by boggiz »

Hello

I have a problem with paho.mqtt on my NAS on Domoticz 2023.1 stable with python 3.9.2

From the docker/Domoticz/Terminal
pip install paho.mqtt (that install v 2.0)
.. succesfully installed

I verify the python PATH is up to date
python3
import sys
sys.path
['', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload',
'/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages']

As you can see nothing about paho.mqtt !

This command import paho.mqtt.client as mqtt is OK under terminal but not with Domoticz
2024-04-10 10:58:08.561 Error: Traceback (most recent call last):
2024-04-10 10:58:08.561 Error: File "Script #2", line 1, in <module>
2024-04-10 10:58:08.561 Error: ModuleNotFoundError: No module named 'paho'


On DZ i update the paths for paho

Code: Select all

# dans /usr/bin j'ai crée un lien   ln -s python3 python
#!/usr/bin/python
import Domoticz

import sys # fonctionne
print("path= ", sys.path)
sys.path.append('/usr/lib/python3.9/site-packages/paho/')
sys.path.append('/usr/lib/python3.9/site-packages/paho/mqtt/')
sys.path.append('/usr/local/lib/python3.9/dist-packages/paho/')
sys.path.append('/usr/local/lib/python3.9/dist-packages/paho/mqtt/')

#import paho.mqtt.client as mqtt
#from paho.mqtt import client as mqtt_client
from mqtt import client as mqtt_client
But nothing better ! the error appears line 15 import ..
What i hat not understand ?
NAS Syno DS718+ with 12Go ram
RFXtrx433XL v1044 with 3dBi antenna
Domoticz 2024.4 on Docker
TFA rain gauge, 4 ways automatic watering program, LINKY consumption, waterflow counter
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Domoticz/Docker paho module not found

Post by waltervl »

Perhaps use pip install with sudo?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests