• lap库就该这么安装


    lap库就该这么安装

    🔱前言

     🔱正确安装命令


    🔱前言

            最近做的项目需要安装lap库,但是当我天真的输入pip install lap准备满心欢喜的等待安装成功却发现...,它报错了,这是一个从未见过的、非常长的报错,它长这个样子:

    1. pip3 install lap
    2. Collecting lap
    3. Using cached lap-0.4.0.tar.gz (1.5 MB)
    4. Preparing metadata (setup.py) ... done
    5. Building wheels for collected packages: lap
    6. Building wheel for lap (setup.py) ... error
    7. error: subprocess-exited-with-error
    8. × python setup.py bdist_wheel did not run successfully.
    9. exit code: 1
    10. ╰─> [59 lines of output]
    11. Partial import of lap during the build process.
    12. Generating cython files
    13. running bdist_wheel
    14. running build
    15. running config_cc
    16. running config_fc
    17. running build_src
    18. /home/max/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    19. warnings.warn(
    20. running build_py
    21. creating build
    22. creating build/lib.linux-x86_64-3.8
    23. creating build/lib.linux-x86_64-3.8/lap
    24. copying lap/lapmod.py -> build/lib.linux-x86_64-3.8/lap
    25. copying lap/__init__.py -> build/lib.linux-x86_64-3.8/lap
    26. running build_ext
    27. creating /tmp/tmpayo2allo/tmp
    28. creating /tmp/tmpayo2allo/tmp/tmpayo2allo
    29. CCompilerOpt.__init__[955] : unable to detect compiler type which leads to treating it as GCC. this is a normal behavior if you're using gcc-like compiler such as MinGW or IBM/XLC.check dist_info:<<
    30. ('linux-x86_64', '/home/max/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc', '-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/max/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/max/anaconda3/include')
    31. >>
    32. creating /tmp/tmp11lkyb7r/home
    33. creating /tmp/tmp11lkyb7r/home/max
    34. creating /tmp/tmp11lkyb7r/home/max/anaconda3
    35. creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib
    36. creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8
    37. creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages
    38. creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy
    39. creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils
    40. creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks
    41. CCompilerOpt.dist_test[576] : CCompilerOpt._dist_test_spawn[711] : Command (/home/max/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/max/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/max/anaconda3/include -fPIC -I/home/max/anaconda3/include/python3.8 -c /home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/test_flags.c -o /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/test_flags.o -MMD -MF /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/test_flags.o.d -mavx512vnni) failed with exit status 1 output ->
    42. x86_64-conda_cos6-linux-gnu-cc: error: unrecognized command line option '-mavx512vnni'; did you mean '-mavx5124vnniw'?
    43. CCompilerOpt.cc_test_flags[1003] : testing failed
    44. CCompilerOpt.dist_test[576] : CCompilerOpt._dist_test_spawn[711] : Command (/home/max/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/max/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/max/anaconda3/include -fPIC -I/home/max/anaconda3/include/python3.8 -c /home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.c -o /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.o -MMD -MF /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.o.d -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq -Werror) failed with exit status 1 output ->
    45. /home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.c: In function 'main':
    46. /home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.c:6:17: error: implicit declaration of function '_mm512_dpbusd_epi32'; did you mean '_mm512_4dpwssd_epi32'? [-Werror=implicit-function-declaration]
    47. __m512i a = _mm512_dpbusd_epi32(_mm512_setzero_si512(), _mm512_setzero_si512(), _mm512_setzero_si512());
    48. ^~~~~~~~~~~~~~~~~~~
    49. _mm512_4dpwssd_epi32
    50. /home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.c:6:17: error: incompatible types when initializing type '__m512i {aka __vector(8) long long int}' using type 'int'
    51. cc1: all warnings being treated as errors
    52. CCompilerOpt.feature_test[1458] : testing failed
    53. CCompilerOpt.generate_dispatch_header[2245] : dispatch header dir build/src.linux-x86_64-3.8/numpy/distutils/include does not exist, creating it
    54. creating /tmp/tmp2sxo2tvd/tmp
    55. creating /tmp/tmp2sxo2tvd/tmp/tmp2sxo2tvd
    56. creating build/temp.linux-x86_64-3.8/lap
    57. In file included from /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
    58. from /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
    59. from /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
    60. from lap/_lapjv.cpp:581:
    61. /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
    62. #warning "Using deprecated NumPy API, disable it with " \
    63. ^~~~~~~
    64. /home/max/anaconda3/compiler_compat/ld: cannot find /lib/libpthread.so.0
    65. /home/max/anaconda3/compiler_compat/ld: cannot find /usr/lib/libpthread_nonshared.a
    66. collect2: error: ld returned 1 exit status
    67. error: Command "/home/max/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++ -pthread -shared -B /home/max/anaconda3/compiler_compat -L/home/max/anaconda3/lib -Wl,-rpath=/home/max/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/max/anaconda3/lib -Wl,-rpath-link,/home/max/anaconda3/lib -L/home/max/anaconda3/lib -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/max/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/max/anaconda3/include build/temp.linux-x86_64-3.8/lap/_lapjv.o build/temp.linux-x86_64-3.8/lap/lapjv.o build/temp.linux-x86_64-3.8/lap/lapmod.o -o build/lib.linux-x86_64-3.8/lap/_lapjv.cpython-38-x86_64-linux-gnu.so" failed with exit status 1
    68. [end of output]
    69. note: This error originates from a subprocess, and is likely not a problem with pip.

     error: subprocess-exited-with-error
      
      × python setup.py bdist_wheel did not run successfully.
      │ exit code: 1
      ╰─> [59 lines of output]
          Partial import of lap during the build process.
          Generating cython files
          running bdist_wheel
          running build
          running config_cc
          running config_fc
          running build_src
          /home/max/anaconda3/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. 
     

            天呐!这是什么错误?完全看不懂好吧...

            后来又在网上反反复复找到了这样一条命令:

    pip install git+git://github.com/gatagat/lap.git

            作者打着包票跟我讲:这次一定行! 

            然后....(哎呦,真香,哎呦诶。)

     🔱正确安装命令

    注视:这是一条非常珍贵的命令!

    conda install -c conda-forge lap
    

    如果不是anaconda环境的小火炮可以试试将conda换成pip喔! 

    完毕!

    如果大家觉得有帮助的话!麻烦点赞+收藏喔,谢谢大家!

  • 相关阅读:
    Android事件分发机制源码解析
    Vue如何引入ElementUI并使用
    网络安全(黑客技术)2024年三个月自学手册
    【Redis】redis中几个基本的全局命令
    2022 年全球十大最佳自动化测试工具
    Android修行手册 - TabLayout全解析 - 和ViewPager联动
    spark入门学习-3-SparkSQL数据抽象
    四、云计算-国产-华为-运维、灾备和迁移+HCIE Cloud相关知识点+笔试题库
    消息中间的应用场景
    【漏洞复现】浙大恩特CRM大客户系统sql注入0day(三)
  • 原文地址:https://blog.csdn.net/qq_51831335/article/details/126458403