Python module not found by command line cover after pip install, but working in shell

Hey there,

I have a seemingly simple problem related to Python modules. But first the setup:
core-2021.7.4
supervisor-2021.06.8
Home Assistant OS 6.1
Raspberry Pi3b

I have bought and installed a Becker Centronic Stick V2 to control my becker covers. To do that I use the pybecker module: GitHub - nicolasberthel/pybecker: Python Library to control becker RF shutters
I installed this module in the SSH shell using pip install pybecker.
That placed the module in /usr/lib/python3.9/site-packages/pybecker and enables me to run commands like python3 -m pybecker -h.

This command works just fine in the SSH shell and I did use it for a command_line based cover entity.
However today after updating HA and rebooting the system I had to reinstall pybecker. Now the command_line cover fails in the UI with the error message /usr/local/bin/python3: No module named pybecker, while the command still works in the shell.
I am probably missing some permission configuration or similar thing.
Would anybody be able to point me in the right direction?

Thank you.

The SSH session is a different Docker container from the one with Home Assistant, that’s why.

Well, okay.

I guess then the update changed it from working to the current state.

But how can I fix it?

The issue is that if you use HA in container or supervised, anyhting that you install in that container gets nuked during update. Container gets replaced with new built.
I was looking into option to run the CMD after container start or inject in entrypoint (standard docker practices) but there is no documentation nor ideas where the container reads this data when supervisor starts the container. This would solve the problem and install the module upon every restart/updated

I do have different issue though, the python module in command_line is not suing the same session. I exec into core container and the script runs fine, but from the command_line integraiton it errors that modules are missing. But it does run in same container.