ESPresense / ad-espresense-ips

DEAD: See https://github.com/ESPresense/ESPresense-companion
64 stars 9 forks source link

Install in Docker - Error #3

Closed ee02217 closed 2 years ago

ee02217 commented 2 years ago

Hi! This seams very promising!

I am running Home Assistant as a docker container, and I installed appdaemon as docker as well just to run this. However, I am having issues being able to run this due to the dependencies. Basically I get the below error trace:

(2/9) Installing libgfortran (10.3.1_git20210424-r2)
(3/9) Installing openblas (0.3.15-r0)
(4/9) Installing py3-numpy (1.20.3-r0)
(5/9) Installing mpdecimal (2.5.1-r1)
(6/9) Installing python3 (3.9.5-r1)
(7/9) Installing python3-dev (3.9.5-r1)
(8/9) Installing py3-numpy-f2py (1.20.3-r0)
(9/9) Installing py3-scipy (1.6.2-r1)
Executing busybox-1.33.1-r3.trigger
OK: 1149 MiB in 82 packages
Collecting numpy
  Downloading numpy-1.21.2.zip (10.3 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting scipy
  Downloading scipy-1.7.1.tar.gz (36.1 MB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status -11:
     command: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpq_6rnp4x
         cwd: /tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e
    Complete output (65 lines):
    setup.py:490: UserWarning: Unrecognized setuptools command ('dist_info --egg-base /tmp/pip-modern-metadata-3rxzco_f'), proceeding with generating Cython sources and expanding templates
      warnings.warn("Unrecognized setuptools command ('{}'), proceeding with "
    Running from SciPy source directory.
    Running scipy/linalg/_generate_pyx.py
    Running scipy/stats/_generate_pyx.py
    Running scipy/special/_generate_pyx.py
    Processing scipy/cluster/_hierarchy.pyx
    Processing scipy/cluster/_vq.pyx
    Processing scipy/cluster/_optimal_leaf_ordering.pyx
    Processing scipy/fftpack/convolve.pyx
    Processing scipy/sparse/_csparsetools.pyx.in
    Processing scipy/sparse/csgraph/_shortest_path.pyx
    Processing scipy/sparse/csgraph/_min_spanning_tree.pyx
    Processing scipy/sparse/csgraph/_flow.pyx
    Processing scipy/sparse/csgraph/_tools.pyx
    Processing scipy/sparse/csgraph/_matching.pyx
    Processing scipy/sparse/csgraph/_reordering.pyx
    Processing scipy/sparse/csgraph/_traversal.pyx
    Processing scipy/spatial/ckdtree.pyx
    Traceback (most recent call last):
      File "/tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e/tools/cythonize.py", line 324, in <module>
        main()
      File "/tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e/tools/cythonize.py", line 320, in main
        find_process_files(root_dir)
      File "/tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e/tools/cythonize.py", line 309, in find_process_files
        for result in pool.imap_unordered(lambda args: process(*args), jobs):
      File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 870, in next
        raise value
      File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 125, in worker
        result = (True, func(*args, **kwds))
      File "/tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e/tools/cythonize.py", line 309, in <lambda>
        for result in pool.imap_unordered(lambda args: process(*args), jobs):
      File "/tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e/tools/cythonize.py", line 243, in process
        processor_function(fromfile, tofile, cwd=path)
      File "/tmp/pip-install-r4jrxkes/scipy_febf0373d4b245f697bbcc33935bdc5e/tools/cythonize.py", line 108, in process_pyx
        raise Exception('Cython failed')
    Exception: Cython failed
    Cythonizing sources
    Traceback (most recent call last):
      File "setup.py", line 356, in generate_cython
        import pip
    ModuleNotFoundError: No module named 'pip'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
        main()
      File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 151, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-3l3o10_y/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-3l3o10_y/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 258, in run_setup
        super(_BuildMetaLegacyBackend,
      File "/tmp/pip-build-env-3l3o10_y/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 629, in <module>
        setup_package()
      File "setup.py", line 613, in setup_package
        generate_cython()
      File "setup.py", line 365, in generate_cython
        raise RuntimeError("Running cythonize failed!")
    RuntimeError: Running cythonize failed!
    ----------------------------------------     
WARNING: Discarding https://files.pythonhosted.org/packages/47/33/a24aec22b7be7fdb10ec117a95e1e4099890d8bbc6646902f443fc7719d1/scipy-1.7.1.tar.gz#sha256=6b47d5fa7ea651054362561a28b1ccc8da9368a39514c1bbf6c0977a1c376764 (from https://pypi.org/simple/scipy/) (requires-python:>=3.7,<3.10). Command errored out with exit status -11: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpq_6rnp4x Check the logs for full command output.
  Downloading scipy-1.7.0.tar.gz (36.1 MB)`
ee02217 commented 2 years ago

I found the issue is that the docker image uses alpine, so scipy is not compatible. Moved to installation on ubuntu and got it to work.

DTTerastar commented 2 years ago

You can get it work on alpine, but you need to use apk add to install the packages: py3-numpy and py3-scipy

DTTerastar commented 2 years ago

But yeah using non-alpine is way easier... I had tried to get appdamon to fix this: https://github.com/AppDaemon/appdaemon/issues/1073

ee02217 commented 2 years ago

You can get it work on alpine, but you need to use apk add to install the packages: py3-numpy and py3-scipy

I tried that but even that did not work. :(

DTTerastar commented 2 years ago

Weird, the hass add-on uses alpine and it does work for me.