mpi4py、pycocotools报错

安装 mpi4py 库时出现编译报错,报错信息为:

复制代码
 gcc -pthread -B /root/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/root/anaconda3/include/python3.7m -c _configtest.c -o _configtest.o
  _configtest.c:2:10: fatal error: mpi.h: No such file or directory
   #include <mpi.h>
            ^~~~~~~
  compilation terminated.
  failure.
  removing: _configtest.c _configtest.o
  error: Cannot compile MPI programs. Check your configuration!!!

sudo apt-get update

sudo apt install libopenmpi-dev

解决掉上面的报错问题,出现下面的

复制代码
collect2: error: ld returned 1 exit status                                                                                                                                                                                                                                      
failure.                                                                                                                                                                                                                                                                        
removing: _configtest.c _configtest.o                                                                                                                                                                                                                                           
error: Cannot link MPI programs. Check your configuration!!!            

参考

sudo apt install python3-mpi4py (但是不管用,又试了下conda)

conda install mpi4py (通过)

但是pycocotools报错

复制代码
/overlay/lib/python3.10/site-packages/numpy/core/include -I./common -I/data/anaconda3/envs/sd-webui/include/python3.10 -c ../common/maskApi.c -o build/temp.linux-x86_64-cpython-310/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
      gcc: error: ../common/maskApi.c: No such file or directory
      gcc: fatal error: no input files
      compilation terminated.
      error: command '/usr/bin/gcc' 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 pycocotools
Failed to build pycocotools

有人说 conda install Cython 但我不管用,你们可以试试。

pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"

最后通过这个装了pycocotools 2.0版本,但要求是pycocotools==2.0.4,不过2.0.4死活不能装起,可以试试2.0版本能不能正常运行。

相关推荐
外域速览8 小时前
OpenAI 智能体「越狱」风波未平,苹果折叠屏 iPhone Ultra 下周三登场
人工智能·ios·iphone
william_yangshun12 小时前
【AI Agent 实战】agent-vision-toolkit 中文版:给纯文本模型(DeepSeek)装上视觉能力
人工智能·多模态
智能体与具身智能12 小时前
TVA具身智能的概念、架构与应用(19)
人工智能·python·具身智能
AI智能体工作室12 小时前
生产级 RAG 检索增强架构实战:向量数据库、混合检索(Hybrid Search)、RRF 融合与重排(Rerank)全链路
人工智能
geinvse_seg13 小时前
我做了个 AI 架构审查员,把整个微服务项目通读了一遍,还顺手做成了 Skill
人工智能
李帅朋13 小时前
微分基本定义笔记
人工智能·笔记·深度学习·神经网络
醍醐实验室13 小时前
下一代端到端全模态(Omni)模型解密:离散音频 Token 化与极速双工流式交互架构
人工智能
米小虾13 小时前
你的 Agent 有 1000 万上下文,为什么第 50 轮就开始失忆?
人工智能·agent
东风破_13 小时前
Text2SQL :用自然语言操作 SQLite 数据库
人工智能·后端
吴佳浩 Alben13 小时前
Agent 怎么做自动化评测?构建端到端的 Agent Evaluation 体系
人工智能·语言模型·架构·自动化·ai编程