lap库就该这么安装

lap库就该这么安装

🔱前言

 🔱正确安装命令


🔱前言

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

pip3 install lap
Collecting lap
  Using cached lap-0.4.0.tar.gz (1.5 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: lap
  Building wheel for lap (setup.py) ... error
  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.
        warnings.warn(
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.8
      creating build/lib.linux-x86_64-3.8/lap
      copying lap/lapmod.py -> build/lib.linux-x86_64-3.8/lap
      copying lap/__init__.py -> build/lib.linux-x86_64-3.8/lap
      running build_ext
      creating /tmp/tmpayo2allo/tmp
      creating /tmp/tmpayo2allo/tmp/tmpayo2allo
      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:<<
      ('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')
      >>
      creating /tmp/tmp11lkyb7r/home
      creating /tmp/tmp11lkyb7r/home/max
      creating /tmp/tmp11lkyb7r/home/max/anaconda3
      creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib
      creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8
      creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages
      creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy
      creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils
      creating /tmp/tmp11lkyb7r/home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks
      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 ->
      x86_64-conda_cos6-linux-gnu-cc: error: unrecognized command line option '-mavx512vnni'; did you mean '-mavx5124vnniw'?
      
      CCompilerOpt.cc_test_flags[1003] : testing failed
      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 ->
      /home/max/anaconda3/lib/python3.8/site-packages/numpy/distutils/checks/cpu_avx512_clx.c: In function 'main':
      /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]
           __m512i a = _mm512_dpbusd_epi32(_mm512_setzero_si512(), _mm512_setzero_si512(), _mm512_setzero_si512());
                       ^~~~~~~~~~~~~~~~~~~
                       _mm512_4dpwssd_epi32
      /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'
      cc1: all warnings being treated as errors
      
      CCompilerOpt.feature_test[1458] : testing failed
      CCompilerOpt.generate_dispatch_header[2245] : dispatch header dir build/src.linux-x86_64-3.8/numpy/distutils/include does not exist, creating it
      creating /tmp/tmp2sxo2tvd/tmp
      creating /tmp/tmp2sxo2tvd/tmp/tmp2sxo2tvd
      creating build/temp.linux-x86_64-3.8/lap
      In file included from /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
                       from /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /home/max/anaconda3/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                       from lap/_lapjv.cpp:581:
      /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]
       #warning "Using deprecated NumPy API, disable it with " \
        ^~~~~~~
      /home/max/anaconda3/compiler_compat/ld: cannot find /lib/libpthread.so.0
      /home/max/anaconda3/compiler_compat/ld: cannot find /usr/lib/libpthread_nonshared.a
      collect2: error: ld returned 1 exit status
      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
      [end of output]
  
  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喔! 

完毕!

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

  • 72
    点赞
  • 76
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 23
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

大气层煮月亮

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

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

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

打赏作者

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

抵扣说明:

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

余额充值