前言

最近在做RL项目等时候,发现遇见一个问题

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

想起来这个问题大概几年前也遇见过,但是当时没有做记录,现在做一个记录~。

正文

1. 问题

Screenshot 2024-05-05 at 18.09.38

Screenshot 2024-05-05 at 18.09.52

2. 解决办法

其实解决办法很简单,参考答案《ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects》

conda安装mpi4py即可

conda install mpi4py

P.S.: 尽量不要用pip安装。

总结

conda环境,就要用conda的命令。(其实我也不知道为什么会得出这个结论,但是估计我之前用pip安装了还是报错,用了conda这个才解决~)

参考

[1] ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects

Q.E.D.


立志做一个有趣的碳水化合物