How to activate venv?

Hi everyone,
please excuse thie rookie question, but I just started using HA (migrated from openhab).

I am using HAOS and have problems with the lupus alarmsystem integration, which seems to be a known issue ( Can not integrate Lupus XT2 Plus · Issue #73547 · home-assistant/core · GitHub.

To fix this I was asked by the creator of the github code to update the lupupy (base of the integration):

pip install lupupy -U

but to activate the venv prior to the upgrade:

But how do I do this?
Isn’t the virtual environment for pylon activated by default?

You help is greatly appreciated.

In HAOS you don’t have a venv.

Ok, ok.
Thank you.

But how can I upgrade the lupupy.py then?
If I run the upgrade as above I get:

➜  /usr pip install lupupy -U
Requirement already satisfied: lupupy in ./lib/python3.10/site-packages (0.1.9)
Requirement already satisfied: colorlog in ./lib/python3.10/site-packages (from lupupy) (6.6.0)
Requirement already satisfied: pyyaml in ./lib/python3.10/site-packages (from lupupy) (6.0)
Requirement already satisfied: requests>=2.12.4 in ./lib/python3.10/site-packages (from lupupy) (2.28.0)
Requirement already satisfied: idna<4,>=2.5 in ./lib/python3.10/site-packages (from requests>=2.12.4->lupupy) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./lib/python3.10/site-packages (from requests>=2.12.4->lupupy) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./lib/python3.10/site-packages (from requests>=2.12.4->lupupy) (1.26.9)
Requirement already satisfied: certifi>=2017.4.17 in ./lib/python3.10/site-packages (from requests>=2.12.4->lupupy) (2022.6.15)
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

So I am obviously root.
But I don’t see any of these files:
/usr/src/homeassistant/
See also my other thread here:
Lupusec integration won’t start - Configuration - Home Assistant Community (home-assistant.io)

Because I re-engineered the connection to the Lupusec system using curl (on openhab), I would like to look into the files to investigate.
(I did not find out yet, how to curl by http(s) to local webservices.)

What version of lupupy do you want?

the latest (0.1.9) as suggested in the github issue:

Can not integrate Lupus XT2 Plus · Issue #73547 · home-assistant/core · GitHub

In the meantime can you just change manually the required lupupy version in homeassistant/components/lupusec/manifest.json to 0.1.9.

But I don’t have any access to /usr/src/homeassistant/homeassistant to check

You should copy the integration code to custom components, then change the manifest.json to require 0.1.9, and also to add a version key. Then restart HA.

If you need a hand with that procedure, ask away.

In fact I think this should work. SSH into your system using the web terminal & ssh addon.

Then use this command

docker exec -it homeassistant bash

you are in the HA container, run the following

mkdir /config/custom_components/lupusec
cp /usr/src/homeassistant/homeassistant/components/lupusec/* /config/custom_components/lupusec/

ctrl-d to exit.

nano config/custom_components/lupusec/manifest.json

Change the requirement line to

"requirements": ["lupupy==0.1,9"],

and add the following

"version": "1.0.0", 

above the last line.
ctrl-x to exit and save

ha core restart

Thank you so much for your assistance!

this returns no matches found
and using ls- la /usr/src does not return anything - that’s what’s confusing me (might be related to docker, where I don’t have experience)

You did enter the first line to enter the docker container?

If so the haos container may have the files arranged differently.

find /|grep lupusec

Stupid me! Sorry!
Yes, I executed it, but got the response that the protection mode is active.
After disabling the protection mode for ssh / terminal, your procedure was successful.
Means, there is no error message in the logs anymore.
Thank you very much!

Now I just need to figure out how to access the Lupus entities, because there is no new device detected yet.