自学内容网 自学内容网

【Ubuntu pip安装mpi4py时报错】

问题:描述问题

pip install mpi4py 报错如下:

/home/daiwenbin/anaconda3/envs/chatglm3_multi/compiler_compat/ld: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so: undefined reference to `opal_list_t_class'
      collect2: error: ld returned 1 exit status
      failure.
      removing: _configtest.c _configtest.o
      error: Cannot link MPI programs. Check your configuration!!!
      [end of output]
  
  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: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mpi4py)

解决方法:

需要把/home/daiwenbin/anaconda3/envs/chatglm3_multi/compiler_compat/ld这个库删除掉,才可以。为了不影响以后的其他程序,建议先备份,执行以下代码。

cp /home/daiwenbin/anaconda3/envs/chatglm3_multi/compiler_compat/ld /home/daiwenbin/anaconda3/envs/chatglm3_multi/compiler_compat/ld.backup

然后再删除:

rm /home/daiwenbin/anaconda3/envs/chatglm3_multi/compiler_compat/ld

就可以安装mpi4py了。


原文地址:https://blog.csdn.net/u010442263/article/details/143690159

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!