李锋镝的博客

  • 首页
  • 时间轴
  • 留言
  • 插件
  • 左邻右舍
  • 关于我
    • 关于我
    • 另一个网站
  • 知识库
  • 赞助
Destiny
自是人生长恨水长东
  1. 首页
  2. 原创
  3. 异常
  4. 正文

hnswlib installation failed

2023年5月26日 4561点热度 3人点赞 2条评论

用Python做langflow的时候,遇到一个奇怪的问题:
Mac 英特尔芯片的本子,导入hnswlib依赖的时候报错
环境:python3
错误信息:

Building wheels for collected packages: hnswlib
  Building wheel for hnswlib (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for hnswlib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running bdist_wheel
      running build
      running build_ext
      creating var
      creating var/folders
      creating var/folders/cv
      creating var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn
      creating var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -I/Users/lifengdi/WorkSpaces/PycharmProjects/langflow/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c /var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T/tmpjn2j37vr.cpp -o var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T/tmpjn2j37vr.o -std=c++14
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -I/Users/lifengdi/WorkSpaces/PycharmProjects/langflow/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c /var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T/tmpvj2j9km2.cpp -o var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T/tmpvj2j9km2.o -fvisibility=hidden
      building 'hnswlib' extension
      creating build
      creating build/temp.macosx-10.9-universal2-cpython-39
      creating build/temp.macosx-10.9-universal2-cpython-39/python_bindings
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -I/private/var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T/pip-build-env-8f2y000v/overlay/lib/python3.9/site-packages/pybind11/include -I/private/var/folders/cv/dtvck8ws72q79_jsyp4scr9h0000gn/T/pip-build-env-8f2y000v/overlay/lib/python3.9/site-packages/numpy/core/include -I./hnswlib/ -I/Users/lifengdi/WorkSpaces/PycharmProjects/langflow/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c ./python_bindings/bindings.cpp -o build/temp.macosx-10.9-universal2-cpython-39/./python_bindings/bindings.o -O3 -march=native -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO=\"0.7.0\" -std=c++14 -fvisibility=hidden
      clang: error: the clang compiler does not support '-march=native'
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects

解决办法:

export HNSWLIB_NO_NATIVE=1
除非注明,否则均为李锋镝的博客原创文章,转载必须以链接形式标明本文链接

本文链接:https://www.lifengdi.com/archives/article/exception/4051

相关文章

  • 解决kubectl exec -it xxxx-service-bfbd45bb9-ktvzj bash -n bit error: exec [POD] [COMMAND] is not supported anymore. Use exec [POD] -- [COMMAND] instead See 'kubectl exec -h' for help and examples
  • 记录一次K8s 部署 Sentinel Dashboard 无法通过 Metric 抓取数据问题
  • redis异常记录
  • Python SQL查询使用动态表名
  • 来来来,用python画一个冰墩墩儿
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可
标签: Python
最后更新:2023年5月26日

李锋镝

既然选择了远方,便只顾风雨兼程。

打赏 点赞
< 上一篇
下一篇 >

文章评论

  • 王光卫博客

    排错也是个耐心的工作啊,ChatGPT有时候也能解决简单的问题,复杂了又要烧脑

    2023年6月6日
    回复
    • 李锋镝

      @王光卫博客 确实很烧脑,头发头快秃了

      2023年6月6日
      回复
  • 1 2 3 4 5 6 7 8 9 11 12 13 14 15 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 57 58 60 61 62 63 64 65 66 67 69 72 74 76 77 78 79 80 81 82 85 86 87 90 92 93 94 95 96 97 98 99
    回复 王光卫博客 取消回复

    露从今夜白,月是故乡明。

    最新 热点 随机
    最新 热点 随机
    SpringBoot框架自动配置之spring.factories和AutoConfiguration.imports 应用型负载均衡(ALB)和网络型负载均衡(NLB)区别 什么是Helm? TransmittableThreadLocal介绍与使用 ReentrantLock深度解析 RedisTemplate和Redisson的区别
    玩博客的人是不是越来越少了?准备入手个亚太的ECS,友友们有什么建议吗?什么是Helm?2024年11月1号 农历十月初一别再背线程池的七大参数了,现在面试官都这么问URL地址末尾加不加“/”有什么区别
    Elasticsearch常用查询 蓝奏云地址怎么天天失效…… LDC是什么? 今天愚人节,我有一个重要消息宣布 GitLab创建新项目,初次提交命令和流程 妹妹的画【2019.07.05】
    标签聚合
    SpringBoot 架构 多线程 IDEA SQL ElasticSearch 教程 docker 分布式 Spring JAVA 数据库 MySQL 日常 面试 JVM 文学 K8s Redis 设计模式
    友情链接
    • i架构
    • 临窗旋墨
    • 博友圈
    • 博客录
    • 博客星球
    • 哥斯拉
    • 志文工作室
    • 搬砖日记
    • 旋律的博客
    • 旧时繁华
    • 林羽凡
    • 知向前端
    • 蜗牛工作室
    • 集博栈
    • 韩小韩博客
    • 風の声音

    COPYRIGHT © 2025 lifengdi.com. ALL RIGHTS RESERVED.

    Theme Kratos Made By Dylan

    津ICP备2024022503号-3