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!