Importing Library's

Hiya guys,

I’m very new to python. and have only ever used it inside app daemon.

what i want to know is if it is possible to import librarys into AD and if so how?

from what i read, you would normally add them with something like the below::
python -m pip install -U pip
python -m pip install -U matplotlib

is there a way to do this in AppDaemon?

Hi,

It looks like you can although I havent tested it yet. I am using docker, are you using docker or hassio?
https://appdaemon.readthedocs.io/en/latest/DOCKER_TUTORIAL.html

############################

Sometimes it can be helpful to install additional Python dependencies into the Docker container before AppDaemon starts, to allow additional libraries to be used from Apps. The Docker script will recursively search the CONF directory for any files named requirements.txt and if it finds them, use them as input to pip3 to install any packages that they describe.

###########################

I’m using Hass.io

So i’m not sure i can do that.

in hassio you need to have a configuration file in the appdaemon section called requirements.txt
and it should look like

{
  "log_level": "info",
  "system_packages": [],
  "python_packages": [
    "PUT_HERE_WHAT_YOU_WOULD_NORMALLY_PIP"
  ]
}
1 Like

Ah you legend. That is built in the App Daemon UI now I think?

i think that Andrew has created a simular option in appdaemon, if thats what you mean. but thats in the dev version.
appdaemon doesnt have an UI (yet) that is coming in version 4. (which is in dev now)

Sorry, I was talking about this:

thats not part from appdaemon but from the addon.

the difference is:
appdaemon and HADashboard are programs written by @aimc
the addon is just a part from hassio that makes it possible to use appdaemon in hassio

and indeed you can set the packages that you want to pip there.
be carefull though, most packages depend on other packages and they give an error and then the addon breaks down and never starts appdaemon.

to see what the problem in that case is, look at the addon log.