openlumi / homeassistant_on_openwrt

Install Home Assistant on your OpenWrt device with a single command
MIT License
157 stars 43 forks source link

"pip install numpy" fails because of Fortran #20

Closed AapoTahkola closed 1 year ago

AapoTahkola commented 1 year ago

camera requires numpy. camera is required by mqtt. On top of that mqtt is required by tasmota. "pip install numpy --no-cache-dir --force-reinstall --no-binary :all -v --log /root/numpy_inst2" fails with

  INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  INFO: build_src
  INFO: building py_modules sources
  creating build
  creating build/src.linux-mips-3.10
  creating build/src.linux-mips-3.10/numpy
  creating build/src.linux-mips-3.10/numpy/distutils
  INFO: building library "npymath" sources
  WARN: Could not locate executable armflang
  WARN: Could not locate executable gfortran
  WARN: Could not locate executable f95
  WARN: Could not locate executable ifort
  WARN: Could not locate executable ifc
  WARN: Could not locate executable lf95
  WARN: Could not locate executable pgfortran
  WARN: Could not locate executable nvfortran
  WARN: Could not locate executable f90
  WARN: Could not locate executable f77
  WARN: Could not locate executable fort
  WARN: Could not locate executable efort
  WARN: Could not locate executable efc
  WARN: Could not locate executable g77
  WARN: Could not locate executable g95
  WARN: Could not locate executable pathf95
  WARN: Could not locate executable nagfor
  WARN: Could not locate executable frt
  WARN: don't know how to compile Fortran code on platform 'posix'

  [Errno 2] No such file or directory: 'gcc'

Any ideas on how to get around this issue? Seems to be same regardless of version. Why is HA depending on Fortran anyway?

devbis commented 1 year ago

Yes, it should be cross-compiled, but numpy requires floating point support in the CPU. What component requires numpy btw?

AapoTahkola commented 1 year ago

I found this churning along with top command:

root@didi:/usr/lib/python3.10/site-packages/homeassistant/components/stream# time /usr/bin/python3 -m pip install PyTurboJPEG==1.6.6 --timeout 60 --upgrade --constraint /usr/lib/python3.10/site-packages/homeassistant/package_constraints.txt --user
Collecting PyTurboJPEG==1.6.6
  Using cached PyTurboJPEG-1.6.6.tar.gz (11 kB)
  Preparing metadata (setup.py) ... done
Collecting numpy
  Using cached numpy-1.23.1.tar.gz (10.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: PyTurboJPEG, numpy
  Building wheel for PyTurboJPEG (setup.py) ... done
  Created wheel for PyTurboJPEG: filename=PyTurboJPEG-1.6.6-py3-none-any.whl size=12169 sha256=f0a5d78bf8ccc3c13056caba0b8f92b6975a7091ced2f9f2e347e8d0f1205b8e
  Stored in directory: /tmp/.cache/wheels/a5/ba/9d/daffdad56d3d6aac0c500b7e58337fb39c23654cd1499c77b7
  error: subprocess-exited-with-error

  × Building wheel for numpy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for numpy (pyproject.toml) ... error
  ERROR: Failed building wheel for numpy
Successfully built PyTurboJPEG
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
Command exited with non-zero status 1
real    22m 31.36s
user    21m 21.32s
sys 0m 58.94s

"Setup failed for camera: Requirements for camera not found: ['PyTurboJPEG==1.6.6']."

Can esphome work without mqtt or why are people preferring it over tasmota? I am a bit overwhelmed on what I still need to fix. mqtt seems to work at times but I have no devices yet.

devbis commented 1 year ago

You should remove PyTurboJPEG from "camera" and "stream" components on your installation. Open manifest.json and leave the requirements = []. Those ones won't work without numpy.

devbis commented 1 year ago

Can esphome work without mqtt

Yes, it can. It uses internal HA API to communicate while Tasmota uses MQTT. ESPHome is more native and possibly provides more options, while tasmota is restricted with HA MQTT discovery functionality.

AapoTahkola commented 1 year ago

Actually I just looked one of my tasmota devices just autoconfigured itself and shows up. Yeay!! Very responsive no lag at all.

Anyway, I do not know should something be done about these errors.

devbis commented 1 year ago

Actually I just looked one of my tasmota devices just autoconfigured itself and shows up. Yeay!! Very responsive no lag at all.

Anyway, I do not know should something be done about these errors.

Remove the requirements from camera/manifest.json and stream/manifest.json