How to install Pytorch 1.0 on Xavier

How to install Pytorch 1.0 on Xavier

Hi,

You can build it from source or install pre-built wheel file.

1. Steps for building from source
https://devtalk.nvidia.com/default/topic/1041716/jetson-agx-xavier/pytorch-install-problem-solved-/post/5284747/#5284747

2. Pre-built wheel
https://devtalk.nvidia.com/default/topic/1041716/jetson-agx-xavier/pytorch-install-problem-solved-/post/5284880/#5284880

Thanks.

Thanks a lot.

pip3 install numpy but failed.

Collecting numpy
Using cached https://files.pythonhosted.org/packages/2d/80/1809de155bad674b494248bcfca0e49eb4c5d8bee58f26fe7a0dd45029e2/numpy-1.15.4.zip
Building wheels for collected packages: numpy
Running setup.py bdist_wheel for numpy … error
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-nkf6fgqh/numpy/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-p71_qwbw --python-tag cp36:
Running from numpy source directory.
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’]
NOT AVAILABLE

atlas_3_10_blas_info:
customize UnixCCompiler
libraries satlas not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/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’]
NOT AVAILABLE

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

accelerate_info:
NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
blas_info:
customize UnixCCompiler
libraries blas not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
blas_src_info:
NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
NOT AVAILABLE

/bin/sh: 1: svnversion: not found
non-existing path in ‘numpy/distutils’: ‘site.cfg’
/bin/sh: 1: svnversion: not found
F2PY Version 2
lapack_opt_info:
lapack_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in [’/usr/local/lib’, ‘/usr/lib’, ‘/usr/lib/aarch64-linux-gnu’]
NOT AVAILABLE

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

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

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries tatlas,tatlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class ‘numpy.distutils.system_info.atlas_3_10_threads_info’>
NOT AVAILABLE

atlas_3_10_info:
customize UnixCCompiler
libraries satlas,satlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries satlas,satlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries satlas,satlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class ‘numpy.distutils.system_info.atlas_3_10_info’>
NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class ‘numpy.distutils.system_info.atlas_threads_info’>
NOT AVAILABLE

atlas_info:
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/local/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/lib
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class ‘numpy.distutils.system_info.atlas_info’>
NOT AVAILABLE

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

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
self.calc_info()
lapack_src_info:
NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
self.calc_info()
NOT AVAILABLE

/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: ‘define_macros’
warnings.warn(msg)
running bdist_wheel
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
creating build
creating build/src.linux-aarch64-3.6
creating build/src.linux-aarch64-3.6/numpy
creating build/src.linux-aarch64-3.6/numpy/distutils
building library “npymath” sources
get_default_fcompiler: matching types: ‘[‘gnu95’, ‘intel’, ‘lahey’, ‘pg’, ‘absoft’, ‘nag’, ‘vast’, ‘compaq’, ‘intele’, ‘intelem’, ‘gnu’, ‘g95’, ‘pathf95’, ‘nagfor’]’
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize LaheyFCompiler
Could not locate executable lf95
customize PGroupFCompiler
Could not locate executable pgfortran
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize NAGFCompiler
customize VastFCompiler
customize CompaqFCompiler
Could not locate executable fort
customize IntelItaniumFCompiler
Could not locate executable efort
Could not locate executable efc
customize IntelEM64TFCompiler
customize GnuFCompiler
Could not locate executable g77
customize G95FCompiler
Could not locate executable g95
customize PathScaleFCompiler
Could not locate executable pathf95
customize NAGFORCompiler
Could not locate executable nagfor
don’t know how to compile Fortran code on platform ‘posix’
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: ‘-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c’
aarch64-linux-gnu-gcc: _configtest.c
aarch64-linux-gnu-gcc -pthread _configtest.o -o _configtest
success!
removing: _configtest.c _configtest.o _configtest.o.d _configtest
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: ‘-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c’
aarch64-linux-gnu-gcc: _configtest.c
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [-Wbuiltin-declaration-mismatch]
int exp (void);
^~~
aarch64-linux-gnu-gcc -pthread _configtest.o -o _configtest
_configtest.o: In function main': /tmp/pip-install-nkf6fgqh/numpy/_configtest.c:6: undefined reference to exp’
collect2: error: ld returned 1 exit status
_configtest.o: In function main': /tmp/pip-install-nkf6fgqh/numpy/_configtest.c:6: undefined reference to exp’
collect2: error: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o _configtest.o.d
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: ‘-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c’
aarch64-linux-gnu-gcc: _configtest.c
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [-Wbuiltin-declaration-mismatch]
int exp (void);
^~~
aarch64-linux-gnu-gcc -pthread _configtest.o -lm -o _configtest
success!
removing: _configtest.c _configtest.o _configtest.o.d _configtest
creating build/src.linux-aarch64-3.6/numpy/core
creating build/src.linux-aarch64-3.6/numpy/core/src
creating build/src.linux-aarch64-3.6/numpy/core/src/npymath
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npymath/npy_math_internal.h
adding ‘build/src.linux-aarch64-3.6/numpy/core/src/npymath’ to include_dirs.
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npymath/ieee754.c
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npymath/npy_math_complex.c
None - nothing done with h_files = [‘build/src.linux-aarch64-3.6/numpy/core/src/npymath/npy_math_internal.h’]
building library “npysort” sources
creating build/src.linux-aarch64-3.6/numpy/core/src/npysort
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npysort/quicksort.c
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npysort/mergesort.c
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npysort/heapsort.c
creating build/src.linux-aarch64-3.6/numpy/core/src/private
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/private/npy_partition.h
adding ‘build/src.linux-aarch64-3.6/numpy/core/src/private’ to include_dirs.
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npysort/selection.c
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/private/npy_binsearch.h
conv_template:> build/src.linux-aarch64-3.6/numpy/core/src/npysort/binsearch.c
None - nothing done with h_files = [‘build/src.linux-aarch64-3.6/numpy/core/src/private/npy_partition.h’, ‘build/src.linux-aarch64-3.6/numpy/core/src/private/npy_binsearch.h’]
building extension “numpy.core._dummy” sources
Generating build/src.linux-aarch64-3.6/numpy/core/include/numpy/config.h
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: ‘-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c’
aarch64-linux-gnu-gcc: _configtest.c
_configtest.c:1:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
_configtest.c:1:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-nkf6fgqh/numpy/setup.py”, line 403, in
setup_package()
File “/tmp/pip-install-nkf6fgqh/numpy/setup.py”, line 395, in setup_package
setup(**metadata)
File “/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/core.py”, line 169, in setup
return old_setup(**new_attr)
File “/home/nvidia/.local/lib/python3.6/site-packages/setuptools/init.py”, line 143, in setup
return distutils.core.setup(**attrs)
File “/usr/lib/python3.6/distutils/core.py”, line 148, in setup
dist.run_commands()
File “/usr/lib/python3.6/distutils/dist.py”, line 955, in run_commands
self.run_command(cmd)
File “/usr/lib/python3.6/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/usr/lib/python3/dist-packages/wheel/bdist_wheel.py”, line 179, in run
self.run_command(‘build’)
File “/usr/lib/python3.6/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/usr/lib/python3.6/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build.py”, line 47, in run
old_build.run(self)
File “/usr/lib/python3.6/distutils/command/build.py”, line 135, in run
self.run_command(cmd_name)
File “/usr/lib/python3.6/distutils/cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “/usr/lib/python3.6/distutils/dist.py”, line 974, in run_command
cmd_obj.run()
File “/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py”, line 148, in run
self.build_sources()
File “/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py”, line 165, in build_sources
self.build_extension_sources(ext)
File “/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py”, line 324, in build_extension_sources
sources = self.generate_sources(sources, ext)
File “/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py”, line 377, in generate_sources
source = func(extension, build_dir)
File “numpy/core/setup.py”, line 422, in generate_config_h
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
File “numpy/core/setup.py”, line 48, in check_types
out = check_types(*a, **kw)
File “numpy/core/setup.py”, line 281, in check_types
“install {0}-dev|{0}-devel.”.format(python))
SystemError: Cannot compile ‘Python.h’. Perhaps you need to install python-dev|python-devel.


Failed building wheel for numpy
Running setup.py clean for numpy
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-nkf6fgqh/numpy/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” clean --all:
Running from numpy source directory.

setup.py clean is not supported, use one of the following instead:

- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
                    files that aren't checked into the git repo)

Add --force to your command to use it anyway if you must (unsupported).


Failed cleaning build dir for numpy
Failed to build numpy
Installing collected packages: numpy
Running setup.py install for numpy … error
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-nkf6fgqh/numpy/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-x9ypoew1/install-record.txt --single-version-externally-managed --compile:
Running from numpy source directory.

Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:

  - `pip install .`       (from a git repo or downloaded source
                           release)
  - `pip install numpy`   (last NumPy release on PyPi)


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']
  NOT AVAILABLE

atlas_3_10_blas_info:
customize UnixCCompiler
  libraries satlas not found in ['/usr/local/lib', '/usr/lib', '/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']
  NOT AVAILABLE

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

accelerate_info:
  NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  self.calc_info()
blas_info:
customize UnixCCompiler
  libraries blas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  self.calc_info()
blas_src_info:
  NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
    Blas (http://www.netlib.org/blas/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  self.calc_info()
  NOT AVAILABLE

/bin/sh: 1: svnversion: not found
non-existing path in 'numpy/distutils': 'site.cfg'
/bin/sh: 1: svnversion: not found
F2PY Version 2
lapack_opt_info:
lapack_mkl_info:
customize UnixCCompiler
  libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
  NOT AVAILABLE

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

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

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries tatlas,tatlas not found in /usr/local/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
  libraries tatlas,tatlas not found in /usr/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
  libraries tatlas,tatlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  NOT AVAILABLE

atlas_3_10_info:
customize UnixCCompiler
  libraries satlas,satlas not found in /usr/local/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
  libraries satlas,satlas not found in /usr/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
  libraries satlas,satlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class 'numpy.distutils.system_info.atlas_3_10_info'>
  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
  libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
  libraries ptf77blas,ptcblas,atlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class 'numpy.distutils.system_info.atlas_threads_info'>
  NOT AVAILABLE

atlas_info:
customize UnixCCompiler
  libraries f77blas,cblas,atlas not found in /usr/local/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/local/lib
customize UnixCCompiler
  libraries f77blas,cblas,atlas not found in /usr/lib
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib
customize UnixCCompiler
  libraries f77blas,cblas,atlas not found in /usr/lib/aarch64-linux-gnu
customize UnixCCompiler
  libraries lapack_atlas not found in /usr/lib/aarch64-linux-gnu
<class 'numpy.distutils.system_info.atlas_info'>
  NOT AVAILABLE

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

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
    Lapack (http://www.netlib.org/lapack/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [lapack]) or by setting
    the LAPACK environment variable.
  self.calc_info()
lapack_src_info:
  NOT AVAILABLE

/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/system_info.py:625: UserWarning:
    Lapack (http://www.netlib.org/lapack/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    the LAPACK_SRC environment variable.
  self.calc_info()
  NOT AVAILABLE

/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building library "npymath" sources
get_default_fcompiler: matching types: '['gnu95', 'intel', 'lahey', 'pg', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor']'
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize LaheyFCompiler
Could not locate executable lf95
customize PGroupFCompiler
Could not locate executable pgfortran
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize NAGFCompiler
customize VastFCompiler
customize CompaqFCompiler
Could not locate executable fort
customize IntelItaniumFCompiler
Could not locate executable efort
Could not locate executable efc
customize IntelEM64TFCompiler
customize GnuFCompiler
Could not locate executable g77
customize G95FCompiler
Could not locate executable g95
customize PathScaleFCompiler
Could not locate executable pathf95
customize NAGFORCompiler
Could not locate executable nagfor
don't know how to compile Fortran code on platform 'posix'
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: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: _configtest.c
aarch64-linux-gnu-gcc -pthread _configtest.o -o _configtest
success!
removing: _configtest.c _configtest.o _configtest.o.d _configtest
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: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: _configtest.c
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [-Wbuiltin-declaration-mismatch]
 int exp (void);
     ^~~
aarch64-linux-gnu-gcc -pthread _configtest.o -o _configtest
_configtest.o: In function `main':
/tmp/pip-install-nkf6fgqh/numpy/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.o: In function `main':
/tmp/pip-install-nkf6fgqh/numpy/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o _configtest.o.d
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: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: _configtest.c
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’ [-Wbuiltin-declaration-mismatch]
 int exp (void);
     ^~~
aarch64-linux-gnu-gcc -pthread _configtest.o -lm -o _configtest
success!
removing: _configtest.c _configtest.o _configtest.o.d _configtest
  adding 'build/src.linux-aarch64-3.6/numpy/core/src/npymath' to include_dirs.
None - nothing done with h_files = ['build/src.linux-aarch64-3.6/numpy/core/src/npymath/npy_math_internal.h']
building library "npysort" sources
  adding 'build/src.linux-aarch64-3.6/numpy/core/src/private' to include_dirs.
None - nothing done with h_files = ['build/src.linux-aarch64-3.6/numpy/core/src/private/npy_partition.h', 'build/src.linux-aarch64-3.6/numpy/core/src/private/npy_binsearch.h']
building extension "numpy.core._dummy" sources
Generating build/src.linux-aarch64-3.6/numpy/core/include/numpy/config.h
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: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/include/python3.6m -c'
aarch64-linux-gnu-gcc: _configtest.c
_configtest.c:1:10: fatal error: Python.h: No such file or directory
 #include <Python.h>
          ^~~~~~~~~~
compilation terminated.
_configtest.c:1:10: fatal error: Python.h: No such file or directory
 #include <Python.h>
          ^~~~~~~~~~
compilation terminated.
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-nkf6fgqh/numpy/setup.py", line 403, in <module>
    setup_package()
  File "/tmp/pip-install-nkf6fgqh/numpy/setup.py", line 395, in setup_package
    setup(**metadata)
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/core.py", line 169, in setup
    return old_setup(**new_attr)
  File "/home/nvidia/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 143, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/install.py", line 62, in run
    r = self.setuptools_run()
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
    return distutils_install.run(self)
  File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
    self.run_command('build')
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build.py", line 47, in run
    old_build.run(self)
  File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py", line 148, in run
    self.build_sources()
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py", line 165, in build_sources
    self.build_extension_sources(ext)
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
    sources = self.generate_sources(sources, ext)
  File "/tmp/pip-install-nkf6fgqh/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
    source = func(extension, build_dir)
  File "numpy/core/setup.py", line 422, in generate_config_h
    moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
  File "numpy/core/setup.py", line 48, in check_types
    out = check_types(*a, **kw)
  File "numpy/core/setup.py", line 281, in check_types
    "install {0}-dev|{0}-devel.".format(python))
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

----------------------------------------

Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-nkf6fgqh/numpy/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-x9ypoew1/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-nkf6fgqh/numpy/

sudo apt-get install python3-numpy

Hi,

The error indicates that the app cannot find the python related header:

_configtest.c:1:10: fatal error: Python.h: No such file or directory

Please install python developer tool first.

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

Thanks.

never mind

sudo pip install pyyaml
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (3.12)

My python version is 3.6.9.When I execute command ‘sudo apt-get install python3-dev’,it prompt me as shown below


When I execute command ‘sudo apt-get install python3.6-dev’,it prompt me as shown below
The following packages have unmet dependencies:
python3.6-dev : Depends: python3.6 (= 3.6.5-3) but 3.6.9-1~18.04 is to be installed
Depends: libpython3.6-dev (= 3.6.5-3) but it is not going to be installed
Depends: libpython3.6 (= 3.6.5-3) but 3.6.9-1~18.04 is to be installed
E: Unable to correct problems, you have held broken packages.

It looks like the Python version is incompatible

Hi 1123864825,

Please open a new topic for your issue. Thanks