Domoticz/Docker paho module not found
Posted: Thursday 11 April 2024 12:42
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
But nothing better ! the error appears line 15 import ..
What i hat not understand ?
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
What i hat not understand ?