Open In App

How to Install “Python3-mpi4py” package on Linux?

Last Updated : 07 Mar, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Mpi4py is a Python package that implements the Message Passing Interface (MPI) standard. It is built on top of the MPI specification and provides an API based on the standard MPI-2 C++ bindings. This library may be installed using both the pip manager and the apt packager. Python2 and Python3 are supported via the Mpi4py package. It supports convenient communication of any pickable python object, fast communication, parallel input and output, dynamic process management, etc. The Mpi4py library will be installed on the Linux system in this article. 

Installing mpi4py package on Linux using PIP

Requirements:

To install the mpi4py package in Linux follow the following steps:

Step 1: First we set the Python3 environment in Linux operating system. So for the installation process, we will use apt manager.

sudo apt-get install python3

Setting-Python3-environment

Step 2: Now the next important step is to install the PIP manager in our system. It is a package installation program in Python whose main purpose is to install and manage Python packages. So for the installation run the following command on the terminal.

sudo apt install python3-pip

Installing-pip-manager

Step 3: Now, we use pip manager to install the mpi4py package. So follow the below command to install the mpi4py package.

sudo pip3 install mpi4py  

or 

sudo apt install python3-mpi4py

Installing-mpi4py

Verifying mpi4py package installation on Linux using PIP

After installing the package, the next main step is to verify the installation of the mpi4py package. So in this step, we are just retrieving the information of the installed package (mpi4py) with the below command on the terminal itself.

python3 -m pip show mpi4py 

The below output will be displayed after successful installation of the mpi4py package on your Linux machine.

Verifying-mpi4py-package-installation


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads