The microscopic model of optical potential (OP) is applied for calculations of the π ± inelastic scattering on the nuclei 28 Si, 58 Ni, 40 Ca, 208 Pb at energies 160, 180, 230 and 290 MeV with excitations of the 2 + and 3 − collective states. In so doing we use the nuclear density distributions and the parameters of the πN-scattering amplitudes earlier obtained by fitting the pion-nucleus elastic cross sections. Thus for inelastic scattering, the only adjusted parameters are the quadrupole β 2 and octupole β 3 deformations of nuclei. The cross sections were obtained by solving the relativistic wave equation, and thus the relativistic and distortion effects in initial and final channels of the process were accounted for exactly. The calculated cross sections were found to be in a fairly well agreement with the corresponding experimental data. One should underline an important role of the nuclear in-medium effect on the πN-scattering amplitude that reveals itself in the both elastic and inelastic scattering.