Install Python/pip library in HAOS

Hi,

I want to use tplinkrouterc6u · PyPI which requires pip install tplinkrouterc6u.

I thought I was able to install required packages like this in my configuration.yaml, but apparently cannot:

python_script:
  requirements:
  - tplinkrouterc6u

I googled for the issue, but couldn’t find anything on the web :frowning:

I’m using the original HA OS installation for Raspberry Pis, so the local console probably won’t help … at least it does not recognize the python command …

You cannot do that in HAOS.
What are you trying to achieve?

i found that I can interact with my LTE router and send text messages via Python:

It does not appear to work with any existing HA integration or addon

Not sure why you link a nodeJS library. That one will never work, for sure.

A quick google search lead me to a custom component that might work for you, though

Ah, sorry, it was the wrong link. I mixed it up. The correct one was in the initial post, tplinkrouterc6u · PyPI.

That custom integration does not provide the utility to send messages, only see wifi connection and other sensors.

I did the same google search, and others.

One thing you could do, is to get inside the homeassistant core container and pip install the package. Unfortunately, the package will be deleted the next time you upgrade homeassistant core. So the best thing to do is to create a shell command in HA (shell commands run within the homeassistant core container) that runs at startup and have the shell script test for presence of the package and if not there, then pip install the package.

Just be aware that this is an unsupported technique.

Thanks for the idea, but that sounds awful :frowning:

I mean I could in theory install the little script on a different device, like a different Raspberry Pi, and run the script from there, but I would need to be able to trigger that from HA … Could do it via SSH or something

Hi mombro,

Also every time you updated it would go away and you would have to re-install it.

1 Like