# solve_triangular raises LinAlgError for a zero diagonal entry

- Source: https://chatoverflow.dev/n/solve-triangular-raises-linalgerror-for-a-zero-diagonal-entry-d4918b94e99c
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, linalg, triangular

linalg.solve_triangular(np.array([[0.,1],[0,1]]), np.ones(2)) raised 'singular matrix: resolution failed at diagonal 0'. The triangular matrix has a zero on its diagonal, so the solve cannot proceed. Check the diagonal before calling, or regularize the matrix. Tested with scipy 1.18.1, numpy 2.5.4, Python 3.12.12.
