Python, dossier installation

Forum dédié aux problématiques concernant les scripts pour DomoticZ.
Entourez votre code et les logs avec les balises nommées code grâce au bouton <\>.
Tonio16
Messages : 349
Inscription : 13 oct. 2017, 17:00

Python, dossier installation

Message par Tonio16 »

Bonjour

J'ai un souci avec un plugin python que j'essaye d'écrire.
Quand je le lance, il me dit:
failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Drexel/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-04-25 18:09:24.955 Error: (Test) Module Import failed, exception: 'ImportError'
2018-04-25 18:09:24.955 Error: (Test) Module Import failed: ' Name: minimalmodbus'
Je reinstalle Minimalmodubs avec pip3, qui le met alors dans: /usr/local/lib/python3.5/dist-packages

Je le déplace vers /usr/lib/python3.5/ plus de problème d'import mais cela me donne:
2018-04-25 18:43:18.300 Error: (test2) 'onHeartbeat' failed 'ValueError'.
2018-04-25 18:43:18.301 Error: (test2) ----> Line 93 in /home/pi/domoticz/plugins/Drexel/plugin.py, function onHeartbeat
2018-04-25 18:43:18.301 Error: (test2) ----> Line 64 in /home/pi/domoticz/plugins/Drexel/plugin.py, function onHeartbeat
2018-04-25 18:43:18.301 Error: (test2) ----> Line 325 in /usr/lib/python3.5/minimalmodbus.py, function read_long
2018-04-25 18:43:18.301 Error: (test2) ----> Line 697 in /usr/lib/python3.5/minimalmodbus.py, function _genericCommand
2018-04-25 18:43:18.301 Error: (test2) ----> Line 798 in /usr/lib/python3.5/minimalmodbus.py, function _performCommand
2018-04-25 18:43:18.301 Error: (test2) ----> Line 1075 in /usr/lib/python3.5/minimalmodbus.py, function _extractPayload
Comment faire pour installer proprement et au bon endroit (pour Domoticz) le module à importer. Peut-on indiquer le plugin le chemin pour minmalmodbus ?

Merci

Antoine
Domoticz V2020.2 sous raspbian-Buster
Raspberry Pi B+ avec Clé Zigate 3.1d Plugin 4.11.011
papoo
Messages : 2029
Inscription : 10 janv. 2016, 11:29
Localisation : Limoges (87)
Contact :

Re: Python, dossier installation

Message par papoo »

il me semblait que le système de plugin ne fonctionnait qu'avec python3.4 (mais je peux me tromper)
as tu essayé
You can also manually download the compressed source files from https://pypi.python.org/pypi/MinimalModbus/ (see the end of that page). In that case you first need to manually install pySerial from https://pypi.python.org/pypi/pyserial.

There are compressed source files for Unix/Linux (.tar.gz) and Windows (.zip). To install a manually downloaded file, uncompress it and run (from within the directory):

python setup.py install
or possibly:

sudo python setup.py install
If using Python 3, then install with:

sudo python3 setup.py install
For Python3 there might be problems with easy_install and pip. In that case, first manually install pySerial and then manually install MinimalModbus.

To make sure it is installed properly, print the _getDiagnosticString() message. See the Support section for instructions.

You can also download the source directly from Linux command line:

wget https://pypi.python.org/packages/source ... 0.7.tar.gz
Change version number to the appropriate value.
http://minimalmodbus.readthedocs.io/en/ ... ation.html
domoticz beta/RaspBerry PI3 stretch
https://pon.fr github
Tonio16
Messages : 349
Inscription : 13 oct. 2017, 17:00

Re: Python, dossier installation

Message par Tonio16 »

Ok, je vais approfondir ce point.

Merci

Antoine
Domoticz V2020.2 sous raspbian-Buster
Raspberry Pi B+ avec Clé Zigate 3.1d Plugin 4.11.011
Répondre