No module named 'paho'

Bonjour,

Depuis quelques jours, le plugin worxlandroids ne démarre plus. Il s’arrète avec le message d’erreur : "No module named ‹ paho ›. J’ai tenté en vain de relancer l’installation des dépendances qui installe ce module sans erreur.
Voici le log d’execution du daemon :

Traceback (most recent call last):
File "/var/www/html/plugins/worxLandroidS/resources/worxLandroidSd.py", line 14, in 
from pyworxcloud import WorxCloud
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/__init__.py", line 11, in 
from .api import LandroidCloudAPI
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/api.py", line 9, in 
from .utils.requests import GET, HEADERS, POST
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/__init__.py", line 10, in 
from .mqtt import MQTT, Command
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/mqtt.py", line 13, in 
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'
Traceback (most recent call last):
File "/var/www/html/plugins/worxLandroidS/resources/worxLandroidSd.py", line 14, in 
from pyworxcloud import WorxCloud
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/__init__.py", line 11, in 
from .api import LandroidCloudAPI
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/api.py", line 9, in 
from .utils.requests import GET, HEADERS, POST
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/__init__.py", line 10, in 
from .mqtt import MQTT, Command
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/mqtt.py", line 13, in 
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'
Traceback (most recent call last):
File "/var/www/html/plugins/worxLandroidS/resources/worxLandroidSd.py", line 14, in 
from pyworxcloud import WorxCloud
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/__init__.py", line 11, in 
from .api import LandroidCloudAPI
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/api.py", line 9, in 
from .utils.requests import GET, HEADERS, POST
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/__init__.py", line 10, in 
from .mqtt import MQTT, Command
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/mqtt.py", line 13, in 
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'
Traceback (most recent call last):
File "/var/www/html/plugins/worxLandroidS/resources/worxLandroidSd.py", line 14, in 
from pyworxcloud import WorxCloud
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/__init__.py", line 11, in 
from .api import LandroidCloudAPI
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/api.py", line 9, in 
from .utils.requests import GET, HEADERS, POST
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/__init__.py", line 10, in 
from .mqtt import MQTT, Command
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/mqtt.py", line 13, in 
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'
Traceback (most recent call last):
File "/var/www/html/plugins/worxLandroidS/resources/worxLandroidSd.py", line 14, in 
from pyworxcloud import WorxCloud
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/__init__.py", line 11, in 
from .api import LandroidCloudAPI
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/api.py", line 9, in 
from .utils.requests import GET, HEADERS, POST
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/__init__.py", line 10, in 
from .mqtt import MQTT, Command
File "/var/www/html/plugins/worxLandroidS/resources/pyworxcloud/utils/mqtt.py", line 13, in 
import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'

Voici le log d’installation des dépendances:

+ echo '*******************Begin of package installation******************'
*******************Begin of package installation******************
+ touch /tmp/jeedom_install_in_progress_worxLandroidS
+ echo 1
+ echo 2
++ find /usr/local/lib/python2.7/dist-packages/ /usr/local/lib/python3.7/dist-packages/ -mindepth 1 -maxdepth 1 -type d -exec du -ks '{}' +
++ awk '$1 <= 4'
++ cut -f 2-
+ RESULTTODELETE=
++ sed 's, ,\ ,g'
++ echo ''
+ RESULTTODELETE2=
+ echo ''
+ xargs rm -rf
+ echo 3
+ sudo pip3 cache purge
Files removed: 4
+ echo 4
+ sudo pip3 install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (23.2.1)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ echo 5
+ sudo pip3 install --force-reinstall --upgrade paho-mqtt
Collecting paho-mqtt
Downloading paho-mqtt-1.6.1.tar.gz (99 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.4/99.4 kB 3.2 MB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: paho-mqtt
Building wheel for paho-mqtt (setup.py): started
Building wheel for paho-mqtt (setup.py): finished with status 'done'
Created wheel for paho-mqtt: filename=paho_mqtt-1.6.1-py3-none-any.whl size=62118 sha256=60828e8c4e1f1d902ce1c1ee0c8c87890f33bcb7a5bd51fe97f6121d15f5ec4c
Stored in directory: /root/.cache/pip/wheels/6a/48/01/c895c027e9b9367ec5470fbf371ee56e795a49ac6a19aa4c9f
Successfully built paho-mqtt
Installing collected packages: paho-mqtt
Attempting uninstall: paho-mqtt
Found existing installation: paho-mqtt 1.6.1
Uninstalling paho-mqtt-1.6.1:
Successfully uninstalled paho-mqtt-1.6.1
Successfully installed paho-mqtt-1.6.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ echo 6
+ php /var/www/html/core/class/../php/jeecli.php plugin dependancy_end worxLandroidS
+ rm /tmp/jeedom_install_in_progress_worxLandroidS
+ echo '*******************End of package installation******************'
*******************End of package installation******************

La vérification des packages systèmes ne relève aucune anomalie :

Package	Type	Status	Obligatoire	Voulu par	Version	Remarque	Commande	Action
apt-transport-https	apt	OK	
oui
core	1.8.2.3			
at	apt	OK	
oui
core	3.1.23-1			
chromium	apt	OK	
non
core	89.0.4389.114-1~deb10u1	Utilisé pour les rapports		
ffmpeg	apt	OK	
oui
core	7:4.1.11-0+deb10u1			
gettext	apt	OK	
oui
core	0.19.8.1-9			
libav-tools	apt	OK (ffmpeg)	
oui
core				
libcurl3-gnutls	apt	OK	
non
core	7.64.0-4+deb10u6	Utilisé pour chromium		
librsync-dev	apt	OK	
oui
core	0.9.7-10+b1			
mariadb-client	apt	OK	
oui
core	1:10.3.39-0+deb10u1			
mariadb-common	apt	OK	
non
core	1:10.3.39-0+deb10u1			
mariadb-server	apt	OK	
non
core	1:10.3.39-0+deb10u1			
net-tools	apt	OK	
oui
core	1.60+git20180626.aebd88e-1			
nmap	apt	OK	
oui
core	7.70+dfsg1-6+deb10u2			
ntpdate	apt	OK	
oui
core	1:4.2.8p12+dfsg-4			
openvpn	apt	OK	
oui
openvpn	2.4.7-1+deb10u1			
php-common	apt	OK	
oui
core	2:69			
php-curl	apt	OK	
oui
core	2:7.3+69			
php-dev	apt	OK	
oui
core	2:7.3+69			
php-gd	apt	OK	
oui
core	2:7.3+69			
php-imap	apt	OK	
oui
core	2:7.3+69			
php-ldap	apt	OK	
non
core	2:7.3+69			
php-mbstring	apt	OK	
oui
core enedis	2:7.3+69			
php-soap	apt	OK	
oui
core	2:7.3+69			
php-ssh2	apt	OK	
oui
core	1.1.2+0.13-4			
php-xml	apt	OK	
oui
core	2:7.3+69			
php-xmlrpc	apt	OK	
oui
core	2:7.3+69			
php-zip	apt	OK	
oui
core	2:7.3+69			
python	apt	OK	
oui
core	2.7.16-1			
python-dev	apt	OK	
oui
core	2.7.16-1			
python-pip	apt	OK	
oui
core	18.1-5			
python3	apt	OK	
oui
core deconz	3.7.3-1			
python3-dev	apt	OK	
oui
deconz worxLandroidS	3.7.3-1			
python3-pip	apt	OK	
oui
core deconz	18.1-5			
python3-pyudev	apt	OK	
oui
deconz	0.21.0-1			
python3-requests	apt	OK	
oui
deconz worxLandroidS	2.21.0-1+deb10u1			
python3-setuptools	apt	OK	
oui
deconz	40.8.0-1			
smbclient	apt	OK	
oui
core	2:4.9.5+dfsg-5+deb10u3			
software-properties-common	apt	OK	
oui
core	0.96.20.2-2			
ssl-cert	apt	OK	
oui
core	1.0.39			
tar	apt	OK	
oui
core	1.30+dfsg-6			
usbutils	apt	OK	
non
core	1:010-3			
wget	apt	OK	
oui
core	1.20.1-1.1			
fasteners	pip2	OK	
oui
core	0.12.0			
future	pip2	OK	
oui
core	0.18.3			
aiohttp	pip3	OK	
oui
worxLandroidS	3.8.4			
backports.zoneinfo	pip3	OK	
oui
worxLandroidS	0.2.1			
paho-mqtt	pip3	OK	
oui
worxLandroidS	1.6.1			
pyserial	pip3	OK	
oui
deconz	3.5			
pyudev	pip3	OK	
oui
deconz	0.24.0			
requests	pip3	OK	
oui
deconz worxLandroidS	2.28.2			
setuptools	pip3	OK	
oui
deconz	67.6.1			
six	pip3	OK	
oui
deconz	1.16.0			
urllib3	pip3	OK	
oui
worxLandroidS	1.26.15			
websocket-client	pip3	OK	
oui
deconz	1.6.1			
wheel	pip3	OK	
oui
deconz	0.40.0			

Voici les photos d’écran:

Merci pour votre aide…

Puis-je aussi avoir une capture de la page santé?

et la capture d’écran de la liste des paquets est coupées, je voudrais le résultat de cette commande:

sudo pip3 list

Bonjour Mips,

Voici la copie d’écran de la page santé :

Le résultat de la commande sudo pip3 list

sudo pip3 list
Package               Version
--------------------- -----------
aiohttp               3.8.4
aiosignal             1.3.1
aiosqlite             0.19.0
android-backup        0.2.0
appdirs               1.4.4
async-timeout         4.0.2
attrs                 23.1.0
awscrt                0.16.13
awsiot                0.1.3
awsiotsdk             1.12.6
backports.zoneinfo    0.2.1
bellows               0.33.1
boto3                 1.26.113
botocore              1.29.113
certifi               2022.12.7
cffi                  1.15.1
charset-normalizer    3.1.0
click                 8.1.3
click-log             0.4.0
coloredlogs           15.0.1
colorzero             2.0
construct             2.10.68
crccheck              1.3.0
croniter              1.3.14
cryptography          40.0.2
defusedxml            0.7.1
frozenlist            1.3.3
gpiozero              1.6.2
humanfriendly         10.0
idna                  3.4
ifaddr                0.2.0
importlib-resources   5.12.0
jmespath              1.0.1
jsonschema            4.17.3
micloud               0.6
multidict             6.0.4
netifaces             0.11.0
paho-mqtt             1.6.1
pip                   23.2.1
pkgutil_resolve_name  1.3.10
pure-pcapy3           1.0.1
pycparser             2.21
pycryptodome          3.17
pydantic              1.10.7
pyrsistent            0.19.3
pyserial              3.5
pyserial-asyncio      0.6
python-dateutil       2.8.2
python-miio           0.5.12
pytz                  2023.3
pytz-deprecation-shim 0.1.0.post0
pyudev                0.24.0
pyusb                 1.2.1
PyYAML                6.0
requests              2.28.2
s3transfer            0.6.0
setuptools            67.6.1
six                   1.16.0
tornado               6.3
tqdm                  4.65.0
typing_extensions     4.5.0
tzdata                2023.3
tzlocal               4.3
urllib3               1.26.15
voluptuous            0.13.1
websocket-client      1.6.1
wheel                 0.40.0
xmodem                0.4.6
yarl                  1.4.2
zeroconf              0.56.0
zha-quirks            0.0.80
zigpy                 0.50.3
zigpy-deconz          0.18.1
zigpy-xbee            0.15.0
zigpy-zigate          0.9.2
zigpy-znp             0.8.2
zipp                  3.15.0

Enfin voici la fin de la copie d’écran de vérification des packages systèmes :

Vincent

Je ne comprend pas, tout est correct…

je peux avoir le résultat de ces commandes?:

python --version
pip --version
python3 --version
pip3 --version

Mips,

Voici les informations demandées:

python --version
Python 2.7.16
pip --version
pip 23.2.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
python3 --version
Python 3.7.3
pip3 --version
pip 23.2.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

Vincent

c’est quoi ce python 3.8 sur buster?

vous avez installé un plugin qui a installé une autre version de python et qui a donc cassé d’autres plugins tel que celui-ci.

Savez-vous quel plugin? si pas, montrez moi la liste des plugins

Voici la liste des plugins:

Est-ce que vous avez tenté d’installer un autre plugin?
est-ce que vous avez tenté d’installer python 3.8?

je viens de perdre 2h à chercher pour un problème causé par quelqu’un qui a cassé l’environnement de python en installant un python3.8 en écrasant la config système donc j’aimerais bien tirer ca au clair…

sinon essayez cette commande:

python3 -m pip install --upgrade pip wheel

montrez moi le résultat et de nouveau les commandes:

python3 --version
pip3 --version

si on ne voit que du 3.7 alors il faudra relancer les dépendances et à nouveau tester le démon

Je n’ai pas essayé d’installer python 3.8. J’avais essayé d’installer un plugin pour la gestion d’un robot aspirateur Dreame. Je ne sais pas si c’est lié. Je l’ai désinstallé depuis, il ne détectait pas les commandes du robot.

Voici les commandes:

pip3 --version
pip 23.2.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
vincent@Jeedom:~$ pip 23.2.1 from /usr/local/lib/python3.8/site-packages/pip (py                                                                                                                                                             thon 3.8)python3 -m pip install --upgrade pip wheel
-bash: syntax error near unexpected token `('
vincent@Jeedom:~$ python3 -m pip install --upgrade pip wheel
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /usr/local/lib/python3.7/dist-packages (23                                                                                                                                                             .0.1)
Collecting pip
  Downloading pip-23.2.1-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 22.3 MB/s eta 0:00:00
Requirement already satisfied: wheel in /usr/local/lib/python3.7/dist-packages (                                                                                                                                                             0.38.4)
Collecting wheel
  Downloading wheel-0.41.2-py3-none-any.whl (64 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.8/64.8 kB 3.8 MB/s eta 0:00:00
Installing collected packages: wheel, pip
  WARNING: The script wheel is installed in '/home/vincent/.local/bin' which is                                                                                                                                                              not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warn                                                                                                                                                             ing, use --no-warn-script-location.
  WARNING: The scripts pip, pip3 and pip3.7 are installed in '/home/vincent/.loc                                                                                                                                                             al/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warn                                                                                                                                                             ing, use --no-warn-script-location.
Successfully installed pip-23.2.1 wheel-0.41.2

[notice] A new release of pip is available: 23.0.1 -> 23.2.1
[notice] To update, run: python3 -m pip install --upgrade pip
python3 --version
Python 3.7.3
pip3 --version
pip 23.2.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

Bonjour,

essayez

sudo apt-get --reinstall install python3-pip

J’ai lancé la commande:

sudo apt-get --reinstall install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/171 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 74775 files and directories currently installed.)
Preparing to unpack .../python3-pip_18.1-5_all.deb ...
Unpacking python3-pip (18.1-5) over (18.1-5) ...
Setting up python3-pip (18.1-5) ...
Processing triggers for man-db (2.8.5-2) ...

Mais cela ne semble pas corriger le problème…

Autre essai:

sudo python3 -m pip uninstall pip
sudo apt-get -y --reinstall install python3-pip

Bravo Mips !

J’ai lancé les commandes :

sudo python3 -m pip uninstall pip
Found existing installation: pip 23.0.1
Uninstalling pip-23.0.1:
  Would remove:
    /usr/bin/pip
    /usr/bin/pip3
    /usr/local/bin/pip
    /usr/local/bin/pip3
    /usr/local/lib/python3.7/dist-packages/pip-23.0.1.dist-info/*
    /usr/local/lib/python3.7/dist-packages/pip/*
Proceed (Y/n)? Y
  Successfully uninstalled pip-23.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

et

sudo apt-get -y --reinstall install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/171 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 74775 files and directories currently installed.)
Preparing to unpack .../python3-pip_18.1-5_all.deb ...
Unpacking python3-pip (18.1-5) over (18.1-5) ...
Setting up python3-pip (18.1-5) ...
Processing triggers for man-db (2.8.5-2) ...

pip est bien repassé en version 3.7 :

pip3 --version
pip 23.2.1 from /home/vincent/.local/lib/python3.7/site-packages/pip (python 3.7)

J’ai lancé enfin une réinstallation des dépendances dans le plugin worxlandroids et tout est rentré dans l’ordre.

Un grand MERCI pour le support !

Vincent

1 « J'aime »

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.