hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
149 stars 46 forks source link

Python issue on launch #291

Closed jimmyeao closed 9 months ago

jimmyeao commented 9 months ago

Problem/Motivation

Add on crashes just after start up

Expected behavior

Add on doesnt crash ;)

Actual behavior

[12:03:25] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/aiohttp/client.py", line 92, in <module>
    import cchardet as chardet
ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/appdaemon", line 5, in <module>
    from appdaemon.__main__ import main
  File "/usr/lib/python3.11/site-packages/appdaemon/__main__.py", line 19, in <module>
    import appdaemon.http as adhttp
  File "/usr/lib/python3.11/site-packages/appdaemon/http.py", line 11, in <module>
    from aiohttp import web
  File "/usr/lib/python3.11/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/usr/lib/python3.11/site-packages/aiohttp/client.py", line 94, in <module>
    import charset_normalizer as chardet  # type: ignore[no-redef]

Steps to reproduce

Happened after upgrade to 0.15.0. and 0.15.1

Proposed changes

jimmyeao commented 9 months ago

if i try and cchardet as a package i get

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/cchardet
      copying src/cchardet/__init__.py -> build/lib.linux-x86_64-cpython-311/cchardet
      copying src/cchardet/version.py -> build/lib.linux-x86_64-cpython-311/cchardet
      warning: build_py: byte-compiling is disabled, skipping.

      running build_ext
      building 'cchardet._cchardet' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/src
      creating build/temp.linux-x86_64-cpython-311/src/cchardet
      creating build/temp.linux-x86_64-cpython-311/src/ext
      creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet
      creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet/src
      creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet/src/LangModels
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/ext/uchardet/src -I/usr/include/python3.11 -c src/cchardet/_cchardet.cpp -o build/temp.linux-x86_64-cpython-311/src/cchardet/_cchardet.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
jimmyeao commented 9 months ago

for some reason i cant remember, (Maybe for NSPANEL?) i had this in my config: apk add --update python3 python3-dev py3-numpy py3-scipy removed, it and now it starts ok :)