gpt4 book ai didi

python - 在 Ubuntu 实例上安装 mpi4py 时出错

转载 作者:行者123 更新时间:2023-12-04 18:29:44 42 4
gpt4 key购买 nike

我正在尝试在我的 Ubuntu 18.04 实例上安装 mpi4py。我已经安装了 python3.6.5。

首先我尝试sudo apt-get build-dep python-mpi4py我得到:

Reading package lists... Done E: You must put some 'source' URIs in your sources.list



然后我尝试简单地安装 pip install mpi4py .我收到一条很长的错误消息,其中包含以下一些最重要的部分:
checking for library 'lmpe' ...
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
x86_64-conda_cos6-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.

大多数库都会发生此故障。我只包括其中之一,并且
  warning: build_clib: command '/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt-mpi" failed


checking for library 'vt-hyb' ...
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc -pthread -B /home/ubuntu/anaconda3/envs/tensorflow_p36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
x86_64-conda_cos6-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.

运行 which mpcc给出:
(tensorflow_p36) ubuntu@ip-172-31-35-200:~$ which mpicc
/home/ubuntu/anaconda3/envs/tensorflow_p36/bin/mpicc

如何将指定的编译器 x86_64-conda_cos6-linux-gnu-cc 添加到我的 PATH 以解决此错误?

最佳答案

只需运行:
conda install -c anaconda mpi4py如图here .

此外,helpful comment通过 Lidandro Dalcin:

I guess you are missing the mpich-mpicc package, this one is a metapackage that depends in the right compiler. Why are you installing mpi4py with pip? Maybe all you need is to conda install mpi4py (available in the conda-forge channel) ?

关于python - 在 Ubuntu 实例上安装 mpi4py 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58355271/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com