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

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


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


1dc618a0ed9580ce8bfa6facb208c08f.png


🔱正确安装命令


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


conda install -c conda-forge lap


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


完毕!


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


相关文章
|
机器学习/深度学习 PyTorch TensorFlow
TensorRT 模型加速——输入、输出、部署流程
本文首先简要介绍 Tensor RT 的输入、输出以及部署流程,了解 Tensor RT 在部署模型中起到的作用。然后介绍 Tensor RT 模型导入流程,针对不同的深度学习框架,使用不同的方法导入模型。
2659 1
|
SQL 关系型数据库 MySQL
Flink CDC 2.0 正式发布,详解核心改进
Flink CDC 2.0.0 版本于 8 月 10 日正式发布,点击了解详情~
Flink CDC 2.0 正式发布,详解核心改进
|
机器学习/深度学习 编解码 监控
目标检测实战(六): 使用YOLOv8完成对图像的目标检测任务(从数据准备到训练测试部署的完整流程)
这篇文章详细介绍了如何使用YOLOv8进行目标检测任务,包括环境搭建、数据准备、模型训练、验证测试以及模型转换等完整流程。
19203 59
目标检测实战(六): 使用YOLOv8完成对图像的目标检测任务(从数据准备到训练测试部署的完整流程)
|
9月前
|
并行计算 PyTorch 算法框架/工具
阿里云PAI-部署Qwen2-VL-72B
阿里云PAI-部署Qwen2-VL-72B踩坑实录
3909 1
|
传感器 人工智能 算法
AI计算机视觉笔记二十七:YOLOV8实现目标追踪
本文介绍了使用YOLOv8实现人员检测与追踪的方法。通过为每个人员分配唯一ID,实现持续追踪,并可统计人数,适用于小区或办公楼出入管理。首先解释了目标检测与追踪的区别,接着详细描述了使用匈牙利算法和卡尔曼滤波实现目标关联的过程。文章提供了基于IOU实现追踪的具体步骤,包括环境搭建、模型加载及追踪逻辑实现。通过示例代码展示了如何使用YOLOv8进行实时视频处理,并实现人员追踪功能。测试结果显示,该方法在实际场景中具有较好的应用潜力。
1705 4
|
Ubuntu 计算机视觉 C++
Ubuntu 20.04 编译 Opencv 4.11,详细步骤(带图)及报错解决,我的踩坑之旅~
Ubuntu 20.04 编译 Opencv 4.11,详细步骤(带图)及报错解决,我的踩坑之旅~
9121 0
|
机器学习/深度学习 自然语言处理 并行计算
【YOLOv8改进 -注意力机制】Mamba之MLLAttention :基于Mamba和线性注意力Transformer的模型
YOLOv8专栏探讨了该目标检测模型的创新改进,包括使用Mamba模型的线性注意力Transformer变体,称为MLLA。Mamba的成功关键在于遗忘门和块设计,MLLA结合了这些优点,提升了视觉任务的性能。文章提供全面分析,并提出MLLA模型,其在效率和准确性上超过多种视觉模型。论文和代码可在提供的链接中找到。MLLA Block的代码示例展示了如何整合关键组件以实现高效运算。更多配置详情见相关链接。
|
机器学习/深度学习 算法 计算机视觉
YOLOv8改进 | 融合模块 | 用Resblock+CBAM卷积替换Conv【轻量化网络】
在这个教程中,介绍了如何将YOLOv8的目标检测模型改进,用Resblock+CBAM替换原有的卷积层。Resblock基于ResNet的残差学习思想,减少信息丢失,而CBAM是通道和空间注意力模块,增强网络对特征的感知。教程详细解释了ResNet和CBAM的原理,并提供了代码示例展示如何在YOLOv8中实现这一改进。此外,还给出了新增的yaml配置文件示例以及如何注册模块和执行程序。作者分享了完整的代码,并对比了改进前后的GFLOPs计算量,强调了这种改进在提升性能的同时可能增加计算需求。教程适合深度学习初学者实践和提升YOLO系列模型的性能。
|
机器学习/深度学习 传感器 编解码
万字长文 | 多目标跟踪最新综述(基于Transformer/图模型/检测和关联/孪生网络)(上)
随着自动驾驶技术的发展,多目标跟踪已成为计算机视觉领域研究的热点问题之一。MOT 是一项关键的视觉任务,可以解决不同的问题,例如拥挤场景中的遮挡、相似外观、小目标检测困难、ID切换等。为了应对这些挑战,研究人员尝试利用transformer的注意力机制、利用图卷积神经网络获得轨迹的相关性、不同帧中目标与siamese网络的外观相似性,还尝试了基于简单 IOU 匹配的 CNN 网络、运动预测的 LSTM。为了把这些分散的技术综合起来,作者研究了过去三年中的一百多篇论文,试图提取出近年来研究者们更加关注的解决 MOT 问题的技术。
万字长文 | 多目标跟踪最新综述(基于Transformer/图模型/检测和关联/孪生网络)(上)