Custom components: install dependencies (permanently)

I’m running the Hassio image on a Raspberry pi.
I created a custom component that uses the asyncws module.
It is defined a service and sends data to an arduino (webserver)
When I manually install it from the terminal via ‘pip install asyncws’ it works fine however after a restart it is no longer working.
I already included it as requirement in my manifest.json but no joy.

I’ve been looking all over but could not find a solution for this issue.
Is there a way to install it permanently onto hassio?

import asyncio
import logging
import json
import asyncws

from .const import (
VERSION,
DOMAIN,
CMDS
)

_LOGGER = logging.getLogger(name)

version = VERSION

async def setup(hass, config):
“Initialize the service”
_LOGGER.info(“Set up of integration %s, version %s”, DOMAIN, VERSION)

async def handle_data(call): 
    myDict = {
        "data_1": 120,
        "data_2": 3,
        "data_1": 0
    }

    websocket = await asyncws.connect('ws://192.168.1.101')

    await websocket.send(json.dumps(myDict))

    while True:
        message = await websocket.recv()
        if message is None:
            break
        print(message)
        break

    hass.services.register(DOMAIN, "rbus", handle_data)
return True

Thx

Can you show your manifest.json and which error you’re getting?

Hi,

Here is the manifest:

{
    "domain": "busclient",
    "name": "bus client",
    "documentation": [],
    "dependencies": ["asyncws"],
    "codeowners": [],
    "requirements": ["asyncws==0.1"]
  }

Error message: ModuleNotFoundError: No module named ‘asyncws’

dependencies are used to tell HA that your integration depends on certain other integrations, it should not contain Python modules (that’s what requirements is for).

When I use a manifest file like yours, HA won’t even start up because of dependencies. When I leave it empty, asyncws gets installed just fine and it seems to work. Check your HA log to see if there are any clues related to the installation of the module, perhaps it’s failing for some reason.

Please stop calling it this. It hasn’t been called that for 12 months. It will only confuse newcomers.