Page 1 of 1

Pydmodbus install with venv environment

Posted: Monday 27 July 2026 7:53
by Pchatill
Hi everybody.
I try to work with a domoticz-Solax-plugin
For that, I need to install pymodbus in a venv environment and I followed the wiki:
mkdir Domoticz_Python_Environment
python3 -m venv Domoticz_Python_Environment
source Domoticz_Python_Environment/bin/activate
pip install --upgrade pip
pip install pymodbus==3.13.0
I modified the init.d like that:
export PYTHONPATH=/home/pi/Domoticz_Python_Environment:$PYTHONPATH
python3 --version --->Python 3.13.5
pip show pymodbus --->version: 3.13.0 (only when venv is activated)
After boot, venv looks deactivated and pip show pymodbus --->"WARNING: Package(s) not found: pymodbus", but I think it's normal
When I enable The domoticz-Solax-plugin harware, the log show:
2026-07-27 07:26:17.910 Error: Modbus Solax: (SolaxMODBUS) failed to load 'plugin.py'.
2026-07-27 07:26:17.931 Error: Modbus Solax: Traceback (most recent call last):
2026-07-27 07:26:17.931 Error: Modbus Solax: File "/home/pi/domoticz/plugins/Domoticz-Solax-plugin/plugin.py", line 28, in <module>
2026-07-27 07:26:17.931 Error: Modbus Solax: from pymodbus.client import ModbusTcpClient
2026-07-27 07:26:17.931 Error: Modbus Solax: ModuleNotFoundError: No module named 'pymodbus'
pydmodbus is not find.
Do I need to install my 'Domoticz-Solax-plugin' somewhere else than /home/pi/Domoticz/plugins?

I'm stuck. Any suggestion?

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 10:00
by jannl
In my 2026.2 docker I still use pymodbus 3.6.9, seems to work ok.

Code: Select all

pip3 install pymodbus==3.6.9
In my customstart.sh

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 10:28
by Pchatill
Thanks for reply Janni.
Do you use pymodbus for the Domoticz-solax-plugin?

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 10:38
by imautohuttraeger
I guess PYTHONPATH needs to be set so that Domoticz can find the virtual environment—for example, /home/pi/domoticz.env. I can't look up the exact command right now, but with the help of AI, it should be a piece of cake.

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 11:08
by Pchatill
Piece of cake ... For you ;) ;)

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 11:21
by jannl
Pchatill wrote: Monday 27 July 2026 10:28 Thanks for reply Janni.
Do you use pymodbus for the Domoticz-solax-plugin?
I use it for solaredge

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 11:31
by imautohuttraeger
Piece of cake ... For you ;) ;)
I see 😉. I can only type on a smartphone right now
, but I hope everything is correct.

1.
Open Chat or or Gemini or Claude (preferred) in your browser.

2.
Copy and paste below textand send this text to the AI:

Code: Select all

I want PYTHONPATH to be set so that Domoticz can find the virtual environment. The path is 

/home/pi/Domoticz_Python_Environment

Please tell me the Linux commands that also ensure, that PYTHONPATH is also known on every reboot of the system or restart of Domoticz
3.
Follow the steps of the answer.

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 11:35
by imautohuttraeger
jannl wrote: Monday 27 July 2026 11:21
Pchatill wrote: Monday 27 July 2026 10:28 Thanks for reply Janni.
Do you use pymodbus for the Domoticz-solax-plugin?
I use it for solaredge
So you use it for a solaredge inverter already and now you additionally want to use it for a solax inverter as well?

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 11:37
by jannl
No I don't, the question was about pymodbus. 3.6.9 is compatible with the new python in Domoticz docker.

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 11:55
by imautohuttraeger
jannl wrote: Monday 27 July 2026 11:37 No I don't, the question was about pymodbus. 3.6.9 is compatible with the new python in Domoticz docker.
Ah - my fault. I was reading with too less attention.

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 15:51
by Pchatill
Thanks a lot for your answers. Thanks also to Claude ...
I will try again since beginning.
I will inform you in few days.
Patrick

Re: Pydmodbus install with venv environment

Posted: Monday 27 July 2026 16:42
by imautohuttraeger
You can even ask Claude to do this:

Code: Select all

I want to install this Plugin

https://github.com/saidlm/Domoticz-Solax-plugin

Please guide me throw all the steps that I needed including the whole environment.
Claude will then lead you step by step including Explanations and maybe some detail questions

Re: Pydmodbus install with venv environment: SOLVED

Posted: Thursday 30 July 2026 20:32
by Pchatill
Thanks a lot imautohuttraeger !!
And thanks a lot Claude!
Claude solved my problem and also re-write the pluging to be compatible with my inverter.
That's my first experience with IA!
That's stunning!

Re: Pydmodbus install with venv environment: SOLVED

Posted: Friday 31 July 2026 0:12
by imautohuttraeger
Pchatill wrote: Thursday 30 July 2026 20:32 Thanks a lot imautohuttraeger !!
And thanks a lot Claude!
👍👍👍