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版本能不能正常运行。

相关推荐
qq_25294131683 分钟前
日本道路病害检测数据集 | 道路病害 裂缝检测 坑洼识别 市政巡检9287期
人工智能·深度学习·yolo·目标检测·计算机视觉·道路检测
yumengxt4 分钟前
「屿梦星途GEO」系列 · 每日AI资讯解读
人工智能
神仙别闹7 分钟前
基于Python实现英词语自动对齐系统
开发语言·python
Qianxueban9 分钟前
如果卷积核大小固定,步长固定,那经过i次卷积,它一个像素的感受野是多大?
人工智能·深度学习·计算机视觉
拆房老料16 分钟前
DeepSeek Super-agent 架构解析:从单任务 Agent 到持续运行的任务系统
人工智能·设计模式·系统架构
民乐团扒谱机17 分钟前
【一文吃透】机器学习 Embedding 降维打击:从底层空间几何原理到 RAG 向量检索工程实战避坑
人工智能·机器学习·embedding
老歌老听老掉牙1 小时前
圆柱端面四平面交线及其在yoz面投影的几何解析与 Python 实现
开发语言·python·平面
超级新零售1 小时前
AI 零售软件是什么?从库存提醒到智能调货的系统分工
大数据·人工智能·零售
女神下凡1 小时前
芯参谋(85):Linux_PPI_NAND_驱动开发指南
linux·运维·arm开发·驱动开发·单片机·嵌入式硬件·设计规范
天远API1 小时前
零信任架构实战:基于天远租凭分期报告构建自动化智慧租房免押分期履约评估网关
运维·人工智能·架构·自动化