树莓派4B下载lap模块报错:Failed building wheel for lap 或 error: subprocess-exited-with-error
当我在树莓派4B中使用yolov8时需要下载lap模块,但是在树莓派中下载lap模块会报出以下错误。无论是下载lap文件夹放入树莓派中,使用以下命令安装lap都会报出以下错误。:可能是树莓派暂不支持lap模块。
·
错误解析
当我在树莓派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
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献27条内容
所有评论(0)