How to install scikit-learn permanently on HAOS for ML predictions?

Hi,

I'm running Home Assistant OS on Intel NUC. I need to use scikit-learn
for a local ML lighting automation system.

My setup:

  • HAOS latest (2026.5)
  • Intel NUC x86_64
  • python_script sandbox - blocks all imports
  • AppDaemon - Alpine Linux, can't compile scikit-learn
  • Studio Code Server - Debian, sklearn installs fine but resets on restart
  • HA Core container - Alpine Linux, same compilation error

What I've tried:

  • pip install in AppDaemon → Alpine, no compiler
  • pip install in SSH → Alpine, no compiler
  • pip install in Studio Code Server → works but resets on restart
  • copy sklearn to /homeassistant/deps/lib/python3.11/site-packages/ → HA Core doesn't find it
  • custom component with requirements → Alpine compilation fails
  • pyscript with allow_all_imports → Alpine compilation fails

Question: What is the correct way to install scikit-learn permanently
on HAOS so it's accessible from automations or custom components?

Thank you

You are not going to pip anything into HAOS.
If you want to control the OS install HA container install.
Now in your setup you state that you have both of these, which is not possible...

If you use the container install, you have control of the OS and can load other containers and pip and whatever...