15808f684SSatish BalayInstallation 25808f684SSatish Balay============ 3eaf87d4bSBarry Smith.. _petsc4py_install: 45808f684SSatish Balay 5eaf87d4bSBarry Smith 6eaf87d4bSBarry SmithUsing **pip** 7eaf87d4bSBarry Smith------------- 85808f684SSatish Balay 95808f684SSatish BalayYou can use :program:`pip` to install :mod:`petsc4py` and its 105808f684SSatish Balaydependencies (:mod:`mpi4py` is optional but highly recommended):: 115808f684SSatish Balay 12eaf87d4bSBarry Smith $ python -m pip install [--user] numpy mpi4py (or pip install [--user] numpy mpi4py) 13eaf87d4bSBarry Smith $ python -m pip install [--user] petsc petsc4py (or pip install [--user] petsc petsc4py) 145808f684SSatish Balay 155808f684SSatish Balay 16*e8c4a563SAlexei ColinFrom PETSc source 17*e8c4a563SAlexei Colin----------------- 185808f684SSatish Balay 19*e8c4a563SAlexei ColinIf you already have downloaded PETSc source and have installed the dependencies 20*e8c4a563SAlexei Colinof `petsc4py`, then to build the `petsc4py` module along with PETSc, add the 21*e8c4a563SAlexei Colin`--with-petsc4py=1` argument to the configure command when building PETSc: 225808f684SSatish Balay 23*e8c4a563SAlexei Colin $ ./configure --with-petsc4py=1 24*e8c4a563SAlexei Colin $ make 25*e8c4a563SAlexei Colin $ make install 26*e8c4a563SAlexei Colin 27*e8c4a563SAlexei ColinThis will install PETSc and the `petsc4py` module into the PETSc directory 28*e8c4a563SAlexei Colinunder the prefix specified to the PETSc configure command. 29