Search code examples
pythonlinuxgoogle-coral

Failed building wheel for lap while loading google-coral example-object-tracker


I'm a noob so please use laymen terms while supplying feedback. I have a coral mini dev board and after shelling in, updating, etc outlined here I start with the examples at the coral site. I follow instructions 1-3 here and then go to gstreamer and follow the instructions in that readme file. Each time building of lap fails. I have tried to pip install it on its own and end up with the same error. This is a brand new board and I have only followed the instructions to update and implement the example. Here is the error that I'm getting regardless of whether I bash install_requirements.sh or pip3 install lap:

mendel@green-orange:~/google-coral/example-object-tracker/gstreamer$ pip3 install lap
Collecting lap
  Using cached https://files.pythonhosted.org/packages/bf/64/d9fb6a75b15e783952b2fec6970f033462e67db32dc43dfbb404c14e91c2/lap-0.4.0.tar.gz
Building wheels for collected packages: lap
  Running setup.py bdist_wheel for lap ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dmwngj35/lap/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-yjkmj6gr --python-tag cp37:
  Partial import of lap during the build process.
  Generating cython files
  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 extension "lap._lapjv" sources
  building data_files sources
  build_src: building npy-pkg config files
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.7
  creating build/lib.linux-aarch64-3.7/lap
  copying lap/__init__.py -> build/lib.linux-aarch64-3.7/lap
  copying lap/lapmod.py -> build/lib.linux-aarch64-3.7/lap
  running build_ext
  customize UnixCCompiler
  customize UnixCCompiler using build_ext
  customize UnixCCompiler
  customize UnixCCompiler using build_ext
  building 'lap._lapjv' extension
  compiling C++ sources
  C compiler: 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
  
  creating build/temp.linux-aarch64-3.7/lap
  compile options: '-I/usr/lib/python3/dist-packages/numpy/core/include -Ilap -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.7m -c'
  aarch64-linux-gnu-g++: lap/_lapjv.cppaarch64-linux-gnu-g++: lap/lapjv.cppaarch64-linux-gnu-g++: lap/lapmod.cpp
  
  
  lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  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 -I/usr/lib/python3/dist-packages/numpy/core/include -Ilap -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.7m -c lap/_lapjv.cpp -o build/temp.linux-aarch64-3.7/lap/_lapjv.o -MMD -MF build/temp.linux-aarch64-3.7/lap/_lapjv.o.d" failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for lap
  Running setup.py clean for lap
Failed to build lap
Installing collected packages: lap
  Running setup.py install for lap ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dmwngj35/lap/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-ftdhrrmv/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    Partial import of lap during the build process.
    Generating cython files
    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 extension "lap._lapjv" sources
    building data_files sources
    build_src: building npy-pkg config files
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.7
    creating build/lib.linux-aarch64-3.7/lap
    copying lap/__init__.py -> build/lib.linux-aarch64-3.7/lap
    copying lap/lapmod.py -> build/lib.linux-aarch64-3.7/lap
    running build_ext
    customize UnixCCompiler
    customize UnixCCompiler using build_ext
    customize UnixCCompiler
    customize UnixCCompiler using build_ext
    building 'lap._lapjv' extension
    compiling C++ sources
    C compiler: 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
    
    creating build/temp.linux-aarch64-3.7/lap
    compile options: '-I/usr/lib/python3/dist-packages/numpy/core/include -Ilap -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.7m -c'
    aarch64-linux-gnu-g++: lap/_lapjv.cppaarch64-linux-gnu-g++: lap/lapjv.cppaarch64-linux-gnu-g++: lap/lapmod.cpp
    
    
    lap/_lapjv.cpp:4:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    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 -I/usr/lib/python3/dist-packages/numpy/core/include -Ilap -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.7m -c lap/_lapjv.cpp -o build/temp.linux-aarch64-3.7/lap/_lapjv.o -MMD -MF build/temp.linux-aarch64-3.7/lap/_lapjv.o.d" failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dmwngj35/lap/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-ftdhrrmv/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-dmwngj35/lap/

Thank you in advance


Solution

  • Can you run sudo apt-get install python3-dev and then retry the demo?