ModuleNotFoundError: No module named 'requests' après recovery

Bonjour,

Je viens de faire un recovery de ma box Atlas puis de relancer l’ensemble des dépendances de mes plugins.

Tout est ok sauf le plugin tahomalocalapi dont le démon ne veut pas redémarrer malgré plusieurs relance des dépendances et un reboot (on ne sait jamais…) et me donne l’erreur suivante :

Traceback (most recent call last): File "/var/www/html/plugins/tahomalocalapi/resources/tahomalocalapid/tahomalocalapid.py", line 29, in <module> import requests ModuleNotFoundError: No module named 'requests'

Il semble pourtant bien que ce module ait été correctement installé (désinstallé puis réinstallé) :

+ echo '*******************Begin of package installation******************'
*******************Begin of package installation******************
+ touch /tmp/jeedom_install_in_progress_tahomalocalapi
+ echo 1
+ echo 2
+ sudo apt update
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Hit:4 https://download.docker.com/linux/debian bookworm InRelease
Hit:5 https://deb.nodesource.com/node_22.x nodistro InRelease
Reading package lists...
Building dependency tree...
Reading state information...
45 packages can be upgraded. Run 'apt list --upgradable' to see them.
+ sudo apt-get install -y python3 python3-pip python3-dev python3-venv
Reading package lists...
Building dependency tree...
Reading state information...
python3 is already the newest version (3.11.2-1+b1).
python3-pip is already the newest version (23.0.1+dfsg-1).
python3-dev is already the newest version (3.11.2-1+b1).
python3-venv is already the newest version (3.11.2-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.
+ echo 3
+ sudo python3 -m venv --upgrade-deps /var/www/html/core/class/../../plugins/tahomalocalapi/resources/python_venv
+ echo 4
+ sudo /var/www/html/core/class/../../plugins/tahomalocalapi/resources/python_venv/bin/python3 -m pip install --upgrade pip wheel
Requirement already satisfied: pip in /var/www/html/plugins/tahomalocalapi/resources/python_venv/lib/python3.11/site-packages (26.1.2)
Requirement already satisfied: wheel in /var/www/html/plugins/tahomalocalapi/resources/python_venv/lib/python3.11/site-packages (0.47.0)
Requirement already satisfied: packaging>=24.0 in /var/www/html/plugins/tahomalocalapi/resources/python_venv/lib/python3.11/site-packages (from wheel) (26.2)
+ echo 5
+ sudo /var/www/html/core/class/../../plugins/tahomalocalapi/resources/python_venv/bin/python3 -m pip install --force-reinstall --upgrade pyserial
Collecting pyserial
Using cached pyserial-3.5-py2.py3-none-any.whl.metadata (1.6 kB)
Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Installing collected packages: pyserial
Attempting uninstall: pyserial
Found existing installation: pyserial 3.5
Uninstalling pyserial-3.5:
Successfully uninstalled pyserial-3.5
Successfully installed pyserial-3.5
+ echo 6
+ sudo /var/www/html/core/class/../../plugins/tahomalocalapi/resources/python_venv/bin/python3 -m pip install --force-reinstall --upgrade requests
Collecting requests
Using cached requests-2.34.2-py3-none-any.whl.metadata (4.8 kB)
Collecting charset_normalizer<4,>=2 (from requests)
Using cached charset_normalizer-3.4.9-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.metadata (41 kB)
Collecting idna<4,>=2.5 (from requests)
Using cached idna-3.18-py3-none-any.whl.metadata (6.1 kB)
Collecting urllib3<3,>=1.26 (from requests)
Using cached urllib3-2.7.0-py3-none-any.whl.metadata (6.9 kB)
Collecting certifi>=2023.5.7 (from requests)
Using cached certifi-2026.7.22-py3-none-any.whl.metadata (2.5 kB)
Using cached requests-2.34.2-py3-none-any.whl (73 kB)
Using cached charset_normalizer-3.4.9-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (213 kB)
Using cached idna-3.18-py3-none-any.whl (65 kB)
Using cached urllib3-2.7.0-py3-none-any.whl (131 kB)
Using cached certifi-2026.7.22-py3-none-any.whl (136 kB)
Installing collected packages: urllib3, idna, charset_normalizer, certifi, requests
Attempting uninstall: urllib3
Found existing installation: urllib3 2.7.0
Uninstalling urllib3-2.7.0:
Successfully uninstalled urllib3-2.7.0
Attempting uninstall: idna
Found existing installation: idna 3.18
Uninstalling idna-3.18:
Successfully uninstalled idna-3.18
Attempting uninstall: charset_normalizer
Found existing installation: charset-normalizer 3.4.9
Uninstalling charset-normalizer-3.4.9:
Successfully uninstalled charset-normalizer-3.4.9
Attempting uninstall: certifi
Found existing installation: certifi 2026.7.22
Uninstalling certifi-2026.7.22:
Successfully uninstalled certifi-2026.7.22
Attempting uninstall: requests
**Found existing installation: requests 2.34.2**
**Uninstalling requests-2.34.2:**
**Successfully uninstalled requests-2.34.2**
**Successfully installed certifi-2026.7.22 charset_normalizer-3.4.9 idna-3.18 requests-2.34.2 urllib3-2.7.0**
+ echo 7
+ sudo /var/www/html/core/class/../../plugins/tahomalocalapi/resources/python_venv/bin/python3 -m pip install --force-reinstall --upgrade pyudev
Collecting pyudev
Using cached pyudev-0.24.4-py3-none-any.whl.metadata (4.4 kB)
Using cached pyudev-0.24.4-py3-none-any.whl (62 kB)
Installing collected packages: pyudev
Attempting uninstall: pyudev
Found existing installation: pyudev 0.24.4
Uninstalling pyudev-0.24.4:
Successfully uninstalled pyudev-0.24.4
Successfully installed pyudev-0.24.4
+ echo 8
+ php /var/www/html/core/class/../php/jeecli.php plugin dependancy_end tahomalocalapi
+ echo 9
+ rm /tmp/jeedom_install_in_progress_tahomalocalapi
+ echo '*******************End of package installation******************'
*******************End of package installation******************

Malgré tout aucun redémarrage du démon..

Merci pour votre aide.

Bonjour,
Dans quelle version d’OS et quelle version du plugin ?

Dans deamon_start(), corriger la ligne qui commence par $cmd = 'python3 ’ :

- $cmd = 'python3 ' . $path . '/tahomalocalapid.py';
+ $cmd = system::getCmdPython3(__CLASS__) . $path . '/tahomalocalapid.py';

devrait permettre au démon de se lancer. Il mourra probablement immédiatement sur une erreur 403 en raison de core/php/.htaccess qui contient Deny from all. Supprimer ce .htaccess pourrait permettre au démon de se lancer, sans aucune garantie de fonctionnement. Je n’ai pas été plus loin.

Ce plugin n’est pas compatible Debian 12. Il est préférable de ne pas l’utiliser tant qu’il n’a pas été mis à jour.

1 « J'aime »

Bonjour,
Il y a une version compatible qu’il suffit de chercher sur le forum qui tourne très bien, c’est pour cela que je demandais quel Os et quelle version du plugin.

Bonjour

Debian 12, plugin en version beta en date du 2025-12-31

Je vais essayer cette version, je n’ai pas pensé à une incompatibilité avec Debian au vu du message python :confused:
Merci !

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.