Giter VIP home page Giter VIP logo

Comments (3)

xuedingebuaimao avatar xuedingebuaimao commented on August 23, 2024 1

I 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.

from safety-starter-agents.

Novice-me avatar Novice-me commented on August 23, 2024

Solution:

  1. Check if any MPI library is installed (e.g. MPICH, OPENMPI), if not, you can install OPENMPI by referring to the following tutorial from Microsoft
    https://docs.microsoft.com/en-us/cognitive-toolkit/Setup-CNTK-on-Linux#open-mpi
  2. After the installation is complete, you can use the following command to locate libmpi.so.12
    sudo find ./ -name libmpi.so.12
  3. Usually, the problem has been solved and you can install the mpi4py library. But if you are using Anaconda or other virtual env, you also need to copy libmpi.so.12 to the lib folder of env

from safety-starter-agents.

wfc1102 avatar wfc1102 commented on August 23, 2024

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.

from safety-starter-agents.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.