Numpy issue on HA core 2024.10.1

Hi all,
I’m on Raspbian GNU/Linux 12 (bookworm) and I have just upgraded HA core from version 2024.9.1 to 2024.10.1. I had a few Python 3.12 dependencies issues (notably with cryptography) that I was able to solve, but there’s one I can’t fix: numpy. Apparently HA requires v1.26.4 of numpy, because it’s not yet ready for v2. Every time I upgrade numpy in my venv to v2.1.2, HA starts without issues, but it reverts the package back to v1.26.4, and the next time I restart HA, I get this error:

Unable to import component: Error importing numpy: you should not try 
to import numpy from its source directory; please exit the numpy source tree, 
and relaunch your python interpreter from there.
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.12 from "/srv/homeassistant/bin/python3"
  * The NumPy version is: "1.26.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

I’ve tried several suggestions I found with Google, followed the guide at Troubleshooting — NumPy v2.2.dev0 Manual, but nothing works. I don’t really understand what I’m supposed to do to solve the issue described in the error.

Anyone has any suggestion for me (besides moving to HA OS, which I intend to do in the coming months once I migrate to a Pi 5 !).

Thanks!

I don’t want to jinx it, but it looks like I was able to solve the issue by running this command in my Python venv:

pip3 install numpy==1.26.4 --global-option="-mfloat-abi=hard" --force-reinstall

Same issue here. For some reason I don’t understand, running bin/hass undoes my 1.26.4 and puts my venv right back to 2.1.3. Forcing back to 1.26.4 is pointless like this. What am I doing wrong??

I have the same issue where it automatically puts the venv back to 2.1.3.

edit: running the following command inside my venv seems to prevent restarting hass from reinstalling bumpy 2.1.3

pip freeze > requirements.txt