How to install numba package on jetson nano

Hi Team,

I am able to install the numba package on jetson xavier following the blog

I had tried to install numba by following the above blog steps, but after installing the llvmlite
I was getting the numba wheel compile error.

I had tried the below steps, but it is not working. Please help me with installing numba package.

Hi,

Could you share the compiling error of numba with us?

Thanks.

Hi ,

Please find the below error.

Building wheels for collected packages: numba, llvmlite
  Building wheel for numba (setup.py) ... error
  ERROR: Command errored out with exit status -4:
   command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jmoy9iul/numba_40e2c0c5b0ce4caca90f4b04204e5642/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jmoy9iul/numba_40e2c0c5b0ce4caca90f4b04204e5642/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-qtejdk_l
       cwd: /tmp/pip-install-jmoy9iul/numba_40e2c0c5b0ce4caca90f4b04204e5642/
  Complete output (0 lines):
  ----------------------------------------
  ERROR: Failed building wheel for numba
  Running setup.py clean for numba
  ERROR: Command errored out with exit status -4:
   command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jmoy9iul/numba_40e2c0c5b0ce4caca90f4b04204e5642/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jmoy9iul/numba_40e2c0c5b0ce4caca90f4b04204e5642/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: /tmp/pip-install-jmoy9iul/numba_40e2c0c5b0ce4caca90f4b04204e5642
  Complete output (0 lines):
  ----------------------------------------
  ERROR: Failed cleaning build dir for numba
  Building wheel for llvmlite (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jw6t8foc
       cwd: /tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/
  Complete output (26 lines):
  running bdist_wheel
  /usr/bin/python3.6 /tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 105, in main_posix
      out = subprocess.check_output([llvm_config, '--version'])
    File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
      **kwargs).stdout
    File "/usr/lib/python3.6/subprocess.py", line 423, in run
      with Popen(*popenargs, **kwargs) as process:
    File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
      restore_signals, start_new_session)
    File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: '/tmp/llvm-9.0.1.src/llvm_build_dir/bin/llvm-config': '/tmp/llvm-9.0.1.src/llvm_build_dir/bin/llvm-config'
 
  During handling of the above exception, another exception occurred:
 
  Traceback (most recent call last):
    File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 168, in <module>
      main()
    File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 158, in main
      main_posix('linux', '.so')
    File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 108, in main_posix
      "to the path for llvm-config" % (llvm_config,))
  RuntimeError: /tmp/llvm-9.0.1.src/llvm_build_dir/bin/llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
  error: command '/usr/bin/python3.6' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Failed to build numba llvmlite
Installing collected packages: llvmlite, numba
  Attempting uninstall: llvmlite
    Found existing installation: llvmlite 0.33.0
    Uninstalling llvmlite-0.33.0:
      Successfully uninstalled llvmlite-0.33.0
    Running setup.py install for llvmlite ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lu99_89u/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/rachel/.local/include/python3.6m/llvmlite
         cwd: /tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/
    Complete output (29 lines):
    running install
    running build
    got version from file /tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/llvmlite/_version.py {'version': '0.31.0', 'full': 'fe7d985f6421d87f613bd414479d29d912771562'}
    running build_ext
    /usr/bin/python3.6 /tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 105, in main_posix
        out = subprocess.check_output([llvm_config, '--version'])
      File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
        **kwargs).stdout
      File "/usr/lib/python3.6/subprocess.py", line 423, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/llvm-9.0.1.src/llvm_build_dir/bin/llvm-config': '/tmp/llvm-9.0.1.src/llvm_build_dir/bin/llvm-config'
   
    During handling of the above exception, another exception occurred:
   
    Traceback (most recent call last):
      File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 168, in <module>
        main()
      File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 158, in main
        main_posix('linux', '.so')
      File "/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/ffi/build.py", line 108, in main_posix
        "to the path for llvm-config" % (llvm_config,))
    RuntimeError: /tmp/llvm-9.0.1.src/llvm_build_dir/bin/llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
    error: command '/usr/bin/python3.6' failed with exit status 1
    ----------------------------------------
  Rolling back uninstall of llvmlite
  Moving to /home/rachel/.local/lib/python3.6/site-packages/llvmlite-0.33.0.dist-info/
   from /home/rachel/.local/lib/python3.6/site-packages/~lvmlite-0.33.0.dist-info
  Moving to /home/rachel/.local/lib/python3.6/site-packages/llvmlite/
   from /home/rachel/.local/lib/python3.6/site-packages/~lvmlite
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jmoy9iul/llvmlite_cfe2756d7dd74a668ac6c9cede993554/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lu99_89u/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/rachel/.local/include/python3.6m/llvmlite Check the logs for full command output.

Please give me suggestions. I had installed the llvmlite-0.33.0.dist in Jetson nano . while installing the numba package it was uninstalling the llvmlite. But when I followed below blog steps for installing on jetson xavier , I didn’t get any errors.

Hi,

Based on the log, it seems that pip still tries to build llvmlite when installing Numba.

Could you check why the installation tool cannot find the llvmlite library?
Maybe the different version or some missing include/library path.

Thanks.

Hi ,

I will check it.

thanks,
sabari

Hi ,

I have checked the llvmlite package and moved the files to python site-packages. But still, I am getting the below errors.

llmlite build location -> /usr/local/lib/python3.6/dist-packages/llvmlite
/usr/local/lib/python3.6/dist-packages/llvmlite-0.30.0.dist-info

I moved the files to the below path.

/home/rachel/.local/lib/python3.6/site-packages

Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting numba==0.39.0
  Downloading numba-0.39.0.tar.gz (1.4 MB)
     |████████████████████████████████| 1.4 MB 7.6 MB/s            
  Preparing metadata (setup.py) ... done
Requirement already satisfied: llvmlite>=0.24.0dev0 in ./.local/lib/python3.6/site-packages (from numba==0.39.0) (0.31.0)
Requirement already satisfied: numpy in ./.local/lib/python3.6/site-packages (from numba==0.39.0) (1.19.5)
Building wheels for collected packages: numba
  Building wheel for numba (setup.py) ... error
  ERROR: Command errored out with exit status -4:
   command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-erd7cj40
       cwd: /tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/
  Complete output (0 lines):
  ----------------------------------------
  ERROR: Failed building wheel for numba
  Running setup.py clean for numba
  ERROR: Command errored out with exit status -4:
   command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: /tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5
  Complete output (0 lines):
  ----------------------------------------
  ERROR: Failed cleaning build dir for numba
Failed to build numba
WARNING: Ignoring invalid distribution -lvmlite (/home/rachel/.local/lib/python3.6/site-packages)
Installing collected packages: numba
    Running setup.py install for numba ... error
    ERROR: Command errored out with exit status -4:
     command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vllwba5m/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/rachel/.local/include/python3.6m/numba
         cwd: /tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/
    Complete output (0 lines):
    ----------------------------------------
ERROR: Command errored out with exit status -4: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ov9id4ue/numba_efc7450884cd49879182bf80042974b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vllwba5m/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/rachel/.local/include/python3.6m/numba Check the logs for full command output.
WARNING: Ignoring invalid distribution -lvmlite (/home/rachel/.local/lib/python3.6/site-packages)
WARNING: Ignoring invalid distribution -lvmlite (/home/rachel/.local/lib/python3.6/site-packages)

I had tried the below steps installing the numba package on jetson nano.

BTW, numba is already compiled/installed in the l4t-ml containers if you can use those: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-ml

In the dockerfile for that container, I install llvm-9 beforehand:
https://github.com/dusty-nv/jetson-containers/blob/be0dca3d19b30e64d129c92e93425c9ede40d65f/Dockerfile.ml#L72

try a clean install with this guide: GitHub - epicmario7133/jetson-nano-tricks: Here you can see many tutorials of how to install programs for jetson nano in a very easy way to me it worked with my jetson nano

Thank you. Let me try to install it.

@AastaLLL @dusty_nv could you give me a suggestion for installing the numba package on jetson nano

I had tried this approach, but it is not working. GitHub - epicmario7133/jetson-nano-tricks: Here you can see many tutorials of how to install programs for jetson nano in a very easy way

Hi,

Could you try the instructions shared by dusty on Jun 18?
It looks like numba can be installed via apt.

Thanks.

Sure. I will try and let you know it.