Jetson tx2 running Jetpack 4.2 pip install scikit_learn install fails

I am running into an issue installing when using the following:
sudo pip install scikit_learn

I have researched this issue and it has come up before. I have tried the fixes for those including those in this post:
https://devtalk.nvidia.com/default/topic/1044627/jetson-agx-xavier/-quot-pip-install-scikit-learn-quot-failing-on-xavier-board/

gfortran --version
returns:
GNU Fortran (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0

Any help would be greatly appreciated.

sudo pip install scikit-learn
Traceback:

ERROR: Complete output from command /usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’"’"’/tmp/pip-install-v81_wsnx/scikit-learn/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /tmp/pip-wheel-u5y654b0 --python-tag cp36:
ERROR: Partial import of sklearn during the build process.
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

blis_info:
customize UnixCCompiler
libraries blis not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

openblas_info:
customize UnixCCompiler
customize UnixCCompiler
libraries openblas not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries tatlas not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu/atlas’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

atlas_3_10_blas_info:
customize UnixCCompiler
libraries satlas not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu/atlas’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu/atlas’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

atlas_blas_info:
customize UnixCCompiler
get_default_fcompiler: matching types: ‘[‘gnu95’, ‘intel’, ‘lahey’, ‘pg’, ‘absoft’, ‘nag’, ‘vast’, ‘compaq’, ‘intele’, ‘intelem’, ‘gnu’, ‘g95’, ‘pathf95’, ‘nagfor’]’
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
compiling ‘_configtest.c’:

/* This file is generated from numpy/distutils/system_info.py */
void ATL_buildinfo(void);
int main(void) {
ATL_buildinfo();
return 0;
}

C compiler: aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC

compile options: ‘-c’
aarch64-linux-gnu-gcc: _configtest.c
aarch64-linux-gnu-gcc -pthread _configtest.o -lf77blas -lcblas -latlas -o _configtest
customize UnixCCompiler
customize UnixCCompiler
FOUND:
language = c
define_macros = [(‘HAVE_CBLAS’, None), (‘NO_ATLAS_INFO’, -1)]
libraries = [‘f77blas’, ‘cblas’, ‘atlas’, ‘f77blas’, ‘cblas’]
library_dirs = [’/usr/lib/aarch64-linux-gnu’]

accelerate_info:
NOT AVAILABLE

FOUND:
  language = c
  define_macros = [('HAVE_CBLAS', None), ('NO_ATLAS_INFO', -1)]
  libraries = ['f77blas', 'cblas', 'atlas', 'f77blas', 'cblas']
  library_dirs = ['/usr/lib/aarch64-linux-gnu']

Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-v81_wsnx/scikit-learn/setup.py”, line 290, in
setup_package()
File “/tmp/pip-install-v81_wsnx/scikit-learn/setup.py”, line 286, in setup_package
setup(**metadata)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/core.py”, line 137, in setup
config = configuration()
File “/tmp/pip-install-v81_wsnx/scikit-learn/setup.py”, line 174, in configuration
config.add_subpackage(‘sklearn’)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py”, line 1036, in add_subpackage
caller_level = 2)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py”, line 1005, in get_subpackage
caller_level = caller_level + 1)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py”, line 942, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File “sklearn/setup.py”, line 66, in configuration
config.add_subpackage(‘utils’)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py”, line 1036, in add_subpackage
caller_level = 2)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py”, line 1005, in get_subpackage
caller_level = caller_level + 1)
File “/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py”, line 942, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File “sklearn/utils/setup.py”, line 8, in configuration
from Cython import Tempita
ModuleNotFoundError: No module named ‘Cython’

ERROR: Failed building wheel for scikit-learn
Running setup.py clean for scikit-learn
Failed to build scikit-learn
Installing collected packages: scikit-learn
Running setup.py install for scikit-learn … error
ERROR: Complete output from command /usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’"’"’/tmp/pip-install-v81_wsnx/scikit-learn/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-cz3_v8cu/install-record.txt --single-version-externally-managed --compile:
ERROR: Partial import of sklearn during the build process.
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

blis_info:
customize UnixCCompiler
  libraries blis not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

openblas_info:
customize UnixCCompiler
customize UnixCCompiler
  libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries tatlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu/atlas', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

atlas_3_10_blas_info:
customize UnixCCompiler
  libraries satlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu/atlas', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu/atlas', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

atlas_blas_info:
customize UnixCCompiler
get_default_fcompiler: matching types: '['gnu95', 'intel', 'lahey', 'pg', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor']'
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
compiling '_configtest.c':

/* This file is generated from numpy/distutils/system_info.py */
void ATL_buildinfo(void);
int main(void) {
  ATL_buildinfo();
  return 0;
}

C compiler: aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC

compile options: '-c'
aarch64-linux-gnu-gcc: _configtest.c
aarch64-linux-gnu-gcc -pthread _configtest.o -lf77blas -lcblas -latlas -o _configtest
customize UnixCCompiler
customize UnixCCompiler
  FOUND:
    language = c
    define_macros = [('HAVE_CBLAS', None), ('NO_ATLAS_INFO', -1)]
    libraries = ['f77blas', 'cblas', 'atlas', 'f77blas', 'cblas']
    library_dirs = ['/usr/lib/aarch64-linux-gnu']

accelerate_info:
  NOT AVAILABLE

  FOUND:
    language = c
    define_macros = [('HAVE_CBLAS', None), ('NO_ATLAS_INFO', -1)]
    libraries = ['f77blas', 'cblas', 'atlas', 'f77blas', 'cblas']
    library_dirs = ['/usr/lib/aarch64-linux-gnu']

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-v81_wsnx/scikit-learn/setup.py", line 290, in <module>
    setup_package()
  File "/tmp/pip-install-v81_wsnx/scikit-learn/setup.py", line 286, in setup_package
    setup(**metadata)
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/core.py", line 137, in setup
    config = configuration()
  File "/tmp/pip-install-v81_wsnx/scikit-learn/setup.py", line 174, in configuration
    config.add_subpackage('sklearn')
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py", line 1036, in add_subpackage
    caller_level = 2)
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py", line 1005, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py", line 942, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "sklearn/setup.py", line 66, in configuration
    config.add_subpackage('utils')
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py", line 1036, in add_subpackage
    caller_level = 2)
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py", line 1005, in get_subpackage
    caller_level = caller_level + 1)
  File "/usr/local/lib/python3.6/dist-packages/numpy/distutils/misc_util.py", line 942, in _get_configuration_from_setup_py
    config = setup_module.configuration(*args)
  File "sklearn/utils/setup.py", line 8, in configuration
    from Cython import Tempita
ModuleNotFoundError: No module named 'Cython'
----------------------------------------

ERROR: Command “/usr/bin/python3 -u -c ‘import setuptools, tokenize;file=’”’"’/tmp/pip-install-v81_wsnx/scikit-learn/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-cz3_v8cu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-v81_wsnx/scikit-learn/

Try “pip install Cython” first

That worked. Thabk you! Sorry for not catching such a simple mistake.