树莓派4B下载lap模块报错:Failed building wheel for lap 或 error: subprocess-exited-with-error

错误解析

当我在树莓派4B中使用yolov8时需要下载lap模块,但是在树莓派中下载lap模块会报出以下错误。

无论是下载lap文件夹放入树莓派中,使用以下命令安装lap

python setup.py build
python setup.py install

都会报出以下错误。

原因:可能是树莓派暂不支持lap模块。

error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [137 lines of output]
/private/var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/pip-install-fuf4kmo1/lap_85f1c5d16bc84c4cb589aeb6a4ee1168/setup.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Partial import of lap during the build process.
/private/var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/pip-install-fuf4kmo1/lap_85f1c5d16bc84c4cb589aeb6a4ee1168/setup.py:223: DeprecationWarning:

    `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
    of the deprecation of `distutils` itself. It will be removed for
    Python >= 3.12. For older Python versions it will remain present.
    It is recommended to use `setuptools < 60.0` for those Python versions.
    For more details, see:
      https://numpy.org/devdocs/reference/distutils_status_migration.html
  
  
    from numpy.distutils.core import setup
  Generating cython files
  running bdist_wheel
  running build
  running config_cc
  INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  running config_fc
  INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  INFO: build_src
  INFO: building extension "lap._lapjv" sources
  INFO: building data_files sources
  INFO: build_src: building npy-pkg config files
  /Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
  !!
  
          ********************************************************************************
          Please avoid running ``setup.py`` directly.
          Instead, use pypa/build, pypa/installer or other
          standards-based tools.
  
          See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
          ********************************************************************************
  
  !!
    self.initialize_options()
  running build_py
  creating build
  creating build/lib.macosx-10.9-universal2-cpython-310
  creating build/lib.macosx-10.9-universal2-cpython-310/lap
  copying lap/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lap
  copying lap/lapmod.py -> build/lib.macosx-10.9-universal2-cpython-310/lap
  running build_ext
  INFO: customize UnixCCompiler
  INFO: customize UnixCCompiler using build_ext
  WARN: CCompilerOpt.__init__[1025] : unable to detect CPU architecture which lead to disable the optimization. check dist_info:<<
  ('macosx-10.9-universal2', 'clang', '-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g')
  >>
  INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-march=native)
  INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
  
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils
  creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks
  INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
  extra options: '-march=native'
  WARN: CCompilerOpt.dist_test[637] : CCompilerOpt._dist_test_spawn[771] : Command (clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.c -o /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o -MMD -MF /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp551a99gy/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o.d -march=native) failed with exit status 1 output ->
  error: unknown target CPU 'apple-m1'
  note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
  
  WARN: CCompilerOpt.cc_test_flags[1090] : testing failed
  INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-O3)
  INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
  
  INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
  extra options: '-O3'
  INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-Werror=switch)
  INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
  
  INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
  extra options: '-Werror=switch'
  INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-Werror)
  INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
  
  INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
  extra options: '-Werror'
  INFO: CCompilerOpt.__init__[1795] : check requested baseline
  INFO: CCompilerOpt.__init__[1804] : check requested dispatch-able features
  INFO: CCompilerOpt.__init__[1820] : initialize targets groups
  INFO: CCompilerOpt.__init__[1822] : parse target group simd_test
  INFO: CCompilerOpt._parse_target_tokens[2033] : skip targets (VX VXE2 VSX2 FMA4 AVX512F VSX4 VXE SSE42 XOP ASIMD AVX512_SKX VSX3 NEON SSE2 VSX (AVX2 FMA3)) not part of baseline or dispatch-able features
  INFO: CCompilerOpt.generate_dispatch_header[2366] : generate CPU dispatch header: (build/src.macosx-10.9-universal2-3.10/numpy/distutils/include/npy_cpu_dispatch_config.h)
  WARN: CCompilerOpt.generate_dispatch_header[2375] : dispatch header dir build/src.macosx-10.9-universal2-3.10/numpy/distutils/include does not exist, creating it
  INFO: customize UnixCCompiler
  WARN: #### ['clang', '-Wno-unused-result', '-Wsign-compare', '-Wunreachable-code', '-fno-common', '-dynamic', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-arch', 'arm64', '-arch', 'x86_64', '-g'] #######
  INFO: customize UnixCCompiler using build_ext
  INFO: building 'lap._lapjv' extension
  INFO: compiling C++ sources
  INFO: C compiler: clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
  
  creating build/temp.macosx-10.9-universal2-cpython-310/lap
  INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ilap -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
  INFO: clang++: lap/_lapjv.cpp
  INFO: clang++: lap/lapjv.cpp
  INFO: clang++: lap/lapmod.cpp
  lap/lapjv.cpp:1:10: fatal error: cannot open file '/usr/local/include/stdio.h': Permission denied
  #include <stdio.h>
           ^
  lap/lapmod.cpp:1:10: fatal error: cannot open file '/usr/local/include/stdio.h': Permission denied
  #include <stdio.h>
           ^
  In file included from lap/_lapjv.cpp:4:
  /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:10: fatal error: cannot open file '/usr/local/include/limits.h': Permission denied
  #include <limits.h>
           ^
  1 error generated.
  1 error generated.
  1 error generated.
  error: Command "clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ilap -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c lap/_lapjv.cpp -o build/temp.macosx-10.9-universal2-cpython-310/lap/_lapjv.o -MMD -MF build/temp.macosx-10.9-universal2-cpython-310/lap/_lapjv.o.d" failed with exit status 1
  INFO:
  ########### EXT COMPILER OPTIMIZATION ###########
  INFO: Platform      :
    Architecture: unsupported
    Compiler    : clang
  
  CPU baseline  :
    Requested   : optimization disabled
    Enabled     : none
    Flags       : none
    Extra checks: none
    Requested   : optimization disabled
  
  CPU dispatch  :
    Enabled     : none
    Generated   : none
  INFO: CCompilerOpt.cache_flush[864] : write cache to path -> /private/var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/pip-install-fuf4kmo1/lap_85f1c5d16bc84c4cb589aeb6a4ee1168/build/temp.macosx-10.9-universal2-cpython-310/ccompiler_opt_cache_ext.py
  [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lap
ERROR: Could not build wheels for lap, which is required to install pyproject.toml-based projects

解决方法

下载lapx模块即可解决:

pip3 install lapx -i https://pypi.tuna.tsinghua.edu.cn/simple
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

街 三 仔

你的鼓励是我创作的最大动力~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值