1Installation 2============ 3.. _petsc4py_install: 4 5 6Using **pip** 7------------- 8 9You can use :program:`pip` to install :mod:`petsc4py` and its 10dependencies (:mod:`mpi4py` is optional but highly recommended):: 11 12 $ python -m pip install [--user] numpy mpi4py (or pip install [--user] numpy mpi4py) 13 $ python -m pip install [--user] petsc petsc4py (or pip install [--user] petsc petsc4py) 14 15 16From PETSc source 17----------------- 18 19If you already have downloaded PETSc source and have installed the dependencies 20of `petsc4py`, then to build the `petsc4py` module along with PETSc, add the 21`--with-petsc4py=1` argument to the configure command when building PETSc: 22 23 $ ./configure --with-petsc4py=1 24 $ make 25 $ make install 26 27This will install PETSc and the `petsc4py` module into the PETSc directory 28under the prefix specified to the PETSc configure command. 29