Error when installing PyTurboJPEG==1.7.1

I’m currently on ha core with python3.11 on FreeBSD 13.2 that I’ve upgraded from python3.9. I can install a more recent version of PyTurboJPEG from pip, but when I launch ha, it tries to install PyTurboJPEG==1.7.1 which gives this error:

Unable to install package PyTurboJPEG==1.7.1: error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [58 lines of output]
      + /srv/homeassistantup/bin/python3.11 /tmp/pip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac/vendored-meson/meson/meson.py setup /tmp/p
ip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac /tmp/pip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac/.mesonpy-0aapnhya/build -Dbuildtype
=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac/.mesonpy-0aapnhya/build/meson-python
-native-file.ini
      The Meson build system
      Version: 1.2.99
      Source dir: /tmp/pip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac
      Build dir: /tmp/pip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac/.mesonpy-0aapnhya/build
      Build type: native build
      Project name: NumPy
      Project version: 1.26.0
      C compiler for the host machine: cc (clang 14.0.5 "FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
")
      C linker for the host machine: cc ld.lld 14.0.5
      C++ compiler for the host machine: c++ (clang 14.0.5 "FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae24
7c)")
      C++ linker for the host machine: c++ ld.lld 14.0.5
      Cython compiler for the host machine: cython (cython 3.0.8)
      Host machine cpu family: x86_64
      Host machine cpu: x86_64
      Program python found: YES (/datastorage/homeassistantup/bin/python3.11)
      Found pkg-config: /usr/local/bin/pkg-config (2.0.3)
      Run-time dependency python found: YES 3.11
      Has header "Python.h" with dependency python-3.11: YES
      Compiler for C supports arguments -fno-strict-aliasing: YES
 Compiler for C supports arguments -ftrapping-math: YES
      Test features "SSE SSE2 SSE3" : Supported
      Test features "SSSE3" : Supported
      Test features "SSE41" : Supported
      Test features "POPCNT" : Supported
      Test features "SSE42" : Supported
      Test features "AVX" : Supported
      Test features "F16C" : Supported
      Test features "FMA3" : Supported
      Test features "AVX2" : Supported
      Test features "AVX512F" : Supported
      Test features "AVX512CD" : Supported
      Test features "AVX512_KNL" : Supported
      Test features "AVX512_KNM" : Unsupported due to Arguments "-msse, -msse2, -msse3, -mssse3, -msse4.1, -mpopcnt, -msse4.2, -mavx, -mf16c, -mfma, -mavx2, -m
no-mmx, -mavx512f, -mavx512cd, -mavx512er, -mavx512pf, -mavx5124fmaps, -mavx5124vnniw, -mavx512vpopcntdq" are not supported
      Test features "AVX512_SKX" : Supported
      Test features "AVX512_CLX" : Supported
      Test features "AVX512_CNL" : Supported
      Test features "AVX512_ICL" : Supported
      Test features "AVX512_SPR" : Unsupported due to Compiler fails against the test code of "AVX512_SPR"
      Configuring npy_cpu_dispatch_config.h using configuration
      Message:
      CPU Optimization Options
        baseline:
          Requested : min
          Enabled   : SSE SSE2 SSE3
        dispatch:
          Requested : max -xop -fma4
          Enabled   : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL

      Library m found: YES
      Found CMake: /usr/local/bin/cmake (3.28.3)
      WARNING: CMake Toolchain: Failed to determine CMake compilers state
      Run-time dependency openblas found: NO (tried pkgconfig and cmake)
      Run-time dependency openblas found: NO (tried pkgconfig and cmake)

      ../../numpy/meson.build:207:4: ERROR: Problem encountered: No BLAS library detected! Install one, or use the `allow-noblas` build option (note, this may
be up to 100x slower for some linear algebra operations).

      A full log can be found at /tmp/pip-install-djqq0o3w/numpy_383b2fd3bdb34ac9a3b5801003fc10ac/.mesonpy-0aapnhya/build/meson-logs/meson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

It seems like it attempts to install it twice, because I get this message twice.

homeassistant version: 2024.2.5
python3.11

Is there a question here? The build error appears to be clear enough:

ERROR: Problem encountered: No BLAS library detected!
Install one, or use the `allow-noblas` build option

I’ve removed numpy then:

pip install numpy --config-settings=setup-args="-Dallow-noblas=true" 

It is not working.

I’m trying to figure out how to install a blas library with numpy.

Ok, it is fixed now. Needed to install openblas. Then, I don’t know if it was needed but I’ve uninstalled numpy and installed back.

pkg install math/openblas

EDIT:

I also had another error ( ccosl not found I think). This fixed it:

# outside of homeassistant venv
git clone https://github.com/numpy/numpy.git numpy-git
cd numpy-git
git checkout v1.26.0
git cherry-pick 040ed2d
git submodule update --init
cd ..
# now enter homeassistant venv
pip install numpy-git/

I’ve got the answer from here: