# PetscPythonInitialize
Initialize Python for use with PETSc and import petsc4py. 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscPythonInitialize(const char pyexe[], const char pylib[])
```

## Input Parameters

- ***pyexe -*** path to the Python interpreter executable, or NULL.
- ***pylib -*** full path to the Python dynamic library, or NULL.





## See Also
 `PetscPythonFinalize()`, `PetscPythonPrintError()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/python/pythonsys.c.html#PetscPythonInitialize">src/sys/python/pythonsys.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex100.c.html">src/ksp/ksp/tutorials/ex100.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex100f.F90.html">src/ksp/ksp/tutorials/ex100f.F90.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/python/pythonsys.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
