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喔!


完毕!


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


相关文章
|
算法 网络协议 测试技术
国密SSL协议之性能测试
国密SSL在实际上线和使用过程中,性能就是一个必须面对的问题。 国密SSL和标准SSL相比,算一个新生事物,没有完善齐备的性能测试工具。 本文针对国密SSL性能测试,描述了相关指标,并提供一些基本的方法和工具。
3022 0
国密SSL协议之性能测试
|
12月前
|
机器学习/深度学习 人工智能 计算机视觉
AAAI2025!北理工团队提出FBRT-YOLO:面向实时航拍图像更快更好的目标检测 |计算机视觉|目标检测
FBRT-YOLO提出专用于航拍图像的实时目标检测模型,通过轻量化设计、增强多尺度融合与小目标优化,在保证高精度的同时显著提升速度,实现复杂场景下更优的性能平衡。
873 0
AAAI2025!北理工团队提出FBRT-YOLO:面向实时航拍图像更快更好的目标检测 |计算机视觉|目标检测
|
机器学习/深度学习 计算机视觉
YOLOv11改进策略【注意力机制篇】| 2024 PPA 并行补丁感知注意模块,提高小目标关注度
YOLOv11改进策略【注意力机制篇】| 2024 PPA 并行补丁感知注意模块,提高小目标关注度
644 1
YOLOv11改进策略【注意力机制篇】| 2024 PPA 并行补丁感知注意模块,提高小目标关注度
|
缓存 PyTorch 算法框架/工具
AI Infra之模型显存管理分析
本文围绕某线上客户部署DeepSeek-R1满血版模型时进行多次压测后,发现显存占用一直上升,从未下降的现象,记录了排查过程。
1944 41
AI Infra之模型显存管理分析
|
机器学习/深度学习 人工智能 文字识别
ultralytics YOLO11 全新发布!(原理介绍+代码详见+结构框图)
本文详细介绍YOLO11,包括其全新特性、代码实现及结构框图,并提供如何使用NEU-DET数据集进行训练的指南。YOLO11在前代基础上引入了新功能和改进,如C3k2、C2PSA模块和更轻量级的分类检测头,显著提升了模型的性能和灵活性。文中还对比了YOLO11与YOLOv8的区别,并展示了训练过程和结果的可视化
27288 0
|
机器学习/深度学习 计算机视觉 异构计算
【YOLOv8改进 - Backbone主干】FasterNet:基于PConv(部分卷积)的神经网络,提升精度与速度,降低参数量。
【YOLOv8改进 - Backbone主干】FasterNet:基于PConv(部分卷积)的神经网络,提升精度与速度,降低参数量。
|
编解码 监控 网络协议
RTSP协议规范与SmartMediaKit播放器技术解析
RTSP协议是实时流媒体传输的重要规范,大牛直播SDK的rtsp播放器基于此构建,具备跨平台支持、超低延迟(100-300ms)、多实例播放、高效资源利用、音视频同步等优势。它广泛应用于安防监控、远程教学等领域,提供实时录像、快照等功能,优化网络传输与解码效率,并通过事件回调机制保障稳定性。作为高性能解决方案,它推动了实时流媒体技术的发展。
850 5
|
人工智能 测试技术 vr&ar
DataDoP :一个大规模多模态数据集,包含 29K 真实世界的自由运动相机轨迹、深度图和详细的动作描述,目的支持艺术化相机轨迹生成。
2025-04-10 ,由浙江大学、上海人工智能实验室、斯坦福大学、香港中文大学和南洋理工大学联合创建了 DataDoP 数据集。该数据集包含 29K 真实世界的自由运动相机轨迹、深度图和详细的动作描述,目的为艺术化相机轨迹生成提供高质量的训练数据,推动基于学习的电影摄影技术发展。 一、研究背景 在视频制作中,相机轨迹设计是传达导演意图和增强视觉叙事的关键工具。传统方法依赖于几何优化或手工设计的程序系统,而近年来的基于学习的方法则继承了结构偏差或缺乏文本对齐,限制了创意合成。 目前遇到困难和挑战: 1、传统方法的局限性:传统方法依赖于几何建模或成本函数工程,限制了创意合成。 2、现有数据集的
|
计算机视觉
目标检测笔记(二):测试YOLOv5各模块的推理速度
这篇文章是关于如何测试YOLOv5中不同模块(如SPP和SPPF)的推理速度,并通过代码示例展示了如何进行性能分析。
749 3
|
机器学习/深度学习 存储 数据可视化
构建个人知识库:Notion vs Roam Research
【5月更文挑战第12天】Notion和Roam Research是两款知名的知识库工具。Notion以其丰富的文本编辑、灵活的笔记组织和强大的集成能力脱颖而出,适合需要多平台同步和精美排版的用户。Roam Research则以双向链接和块概念为核心,构建知识网络,便于发现信息间的关联,适合深度学习和探索性思考。选择取决于个人需求和偏好。