hassio-addons / addon-appdaemon3

AppDaemon3 - Home Assistant Community Add-ons
https://addons.community
MIT License
41 stars 12 forks source link

System packages are not being installed on addon startup #43

Closed alex-savin closed 5 years ago

alex-savin commented 5 years ago

Problem/Motivation

System packages are not being installed on addon startup. Even when I tried to install package inside running image it didn't do it.

Expected behavior

On command apk add py3-psycopg2 system wants to add package

Actual behavior

System do update instead of add packages

Steps to reproduce

root@a0d7b954-appdaemon3:/$ apk add py3-psycopg2
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
OK: 122 MiB in 54 packages

root@a0d7b954-appdaemon3:/$ apk add py3-psycopg2
OK: 122 MiB in 54 packages

PS: I have x86_64 instances

root@a0d7b954-appdaemon3:/$ uname -a
Linux a0d7b954-appdaemon3 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 Linux
addons-assistant[bot] commented 5 years ago

:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

NigelRook commented 5 years ago

I've been having similar issues getting py3-numpy any py3-scipy installed. My current workaround is to install them through python_packages, but that takes ~15 minutes every time I restart through hass.io, which is not ideal.

I've been able to figure out the cause. The packages are actually installing, but apk is grabbing the alpine 3.9 packages, which install the modules for python 3.6, since that's the version of python alpine 3.9 uses. The appdaemon container (and the base-python container from which it inherits) use python 3.7. This means none of the the py3-* packages will actually install accessible modules.

I'll drop an issue against base-python for better visibility, though there's multiple ways of approaching this.

frenck commented 5 years ago

You cannot use Alpine's system packages since those are based on a different Python version.

addons-assistant[bot] commented 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.