In root dir (here /opt/petsc)
For real support:
sudo python3 ./configure PETSC_ARCH=arch-real --with-scalar-type=real
sudo make PETSC_DIR=/opt/petsc PETSC_ARCH=arch-real allFor complex support:`
sudo python3 ./configure PETSC_ARCH=arch-complex --with-scalar-type=complex
sudo make PETSC_DIR=/opt/petsc PETSC_ARCH=arch-complex allIn conda env
export PETSC_DIR=/opt/petsc <!-- or wherever your source dir is-->
export PETSC_ARCH=arch-real:arch-complex
pip install petsc4pySelect type in Python PETSc
petsc4py.init(arch='arch-complex') #<!-- or arch-real -->