Open zsn2021 opened 2 years ago
Solution:
libmpi.so.12
sudo find ./ -name libmpi.so.12
libmpi.so.12
to the lib
folder of envI directly used the command "conda install mpi4py", which installed the following packages.
The following NEW packages will be INSTALLED:
ipykernel anaconda/pkgs/main/linux-64::ipykernel-6.9.1-py37h06a4308_0 mpi anaconda/pkgs/main/linux-64::mpi-1.0-mpich mpi4py anaconda/pkgs/main/linux-64::mpi4py-3.1.4-py37hfc96bbd_0 mpich anaconda/pkgs/main/linux-64::mpich-3.3.2-external_0
Then I ran "from mpi4py import MPI" and got the ImportError. Initially, I found there was no "libmpi.so.12" in my conda env's lib folder, which I thought corresponds to the 3rd point you mentioned, so I copied it from pkgs/... and now have the following "libmpi.so.12"
/home/nico/anaconda3/lib/libmpi.so.12 /home/nico/anaconda3/envs/condavenv1/lib/libmpi.so.12 /home/nico/anaconda3/pkgs/mpich-3.3.2-hc856adb_0/lib/libmpi.so.12
but still get the same error.
Same error here: from mpi4py import MPI ImportError: libmpi.so.12: cannot open shared object file: No such file or directory
conda install -c conda-forge mpi4py conda install mpi4py
conda uninstall mpi4py pip uninstall mpi4py
install and uninstall several times does not work. When conda uninstall it shows:
mpi-1.0-mpich mpi4py-3.1.4-py38hfc96bbd_0 mpich-3.3.2-external_0
Before give up, I tried
pip install mpi4py
Successfully installed mpi4py-3.1.5 My program runs smoothly. It seems the mpi4py version matters. conda install differs from pip install by selecting different version at this issue.
System: Ubuntu 18 04 Compiler: PyCharm There was a problem installing the dependency package mpi4py==3.0.2 Does anyone have a similar problem? How to solve it?