Cannot install scikit_learn on Jetson Nano

I followed these topics:

  1. https://devtalk.nvidia.com/default/topic/1044958/jetson-agx-xavier/scikit-learn-for-python-3-on-jetson-xavier/
  2. https://devtalk.nvidia.com/default/topic/1049684/jetson-nano/errors-during-install-sklearn-/
  3. https://github.com/scikit-learn/scikit-learn/issues/12707

Here are all commands I run:

sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev

sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools

sudo pip3 install -U numpy==1.16.1 future==0.17.1 mock==3.0.5 h5py==2.9.0 keras_preprocessing==1.0.5 keras_applications==1.0.8 gast==0.2.2 enum34 futures protobuf

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v43 tensorflow-gpu==1.15.0+nv19.12

sudo apt-get install python3-opencv
sudo apt-get install python3-pandas
sudo apt-get install python3-keras
sudo apt-get install gfortran
sudo apt-get install python3-scipy
sudo apt-get install python3-matplotlib
sudo apt-get install python3-imageio

pip3 install dlib
sudo apt-get install -y build-essential libatlas-base-dev

pip3 install --upgrade setuptools
sudo pip3 install -U setuptools
sudo apt-get install libpcap-dev libpq-dev
sudo pip3 install cython
sudo pip3 install git+https://github.com/scikit-learn/scikit-learn.git

and I got the long error below

creating build/temp.linux-aarch64-3.6/scipy/fft
    creating build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft
    compile options: '-DPOCKETFFT_PTHREADS -I/home/dlinano/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c'
    extra options: '-std=c++14 -fvisibility=hidden'
    aarch64-linux-gnu-g++: scipy/fft/_pocketfft/pypocketfft.cxx
    scipy/fft/_pocketfft/pypocketfft.cxx:15:10: fatal error: pybind11/pybind11.h: No such file or directory
     #include <pybind11/pybind11.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    Running from scipy source directory.
    /usr/local/lib/python3.6/dist-packages/numpy/distutils/system_info.py:728: UserWarning: Specified path /usr/local/include/python3.6m is invalid.
      return self.get_paths(self.section, key)
    error: Command "aarch64-linux-gnu-g++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPOCKETFFT_PTHREADS -I/home/dlinano/.local/include/python3.6m -I/usr/local/include/python3.6 -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/include/python3.6m -c scipy/fft/_pocketfft/pypocketfft.cxx -o build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o -MMD -MF build/temp.linux-aarch64-3.6/scipy/fft/_pocketfft/pypocketfft.o.d -std=c++14 -fvisibility=hidden" failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for scipy
  Failed to build scipy
  ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-dfzx1730/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy>=1.13.3' 'scipy>=0.19.1' Check the logs for full command output.

Please check this full logs:
https://drive.google.com/file/d/1gLcSq86Aic5uFoPr8k6Cp366eRB2tlfw/view?usp=sharing

Please don’t use “sudo pip”. It’s very common, but is dangerous and can result in system breakage.

sudo apt install python3-sklearn

Should be all that is needed to install sklearn. If you need a newer version, use pip, but omit the sudo for a user install or install it in a virtual environment.