Price elasticity of demand of CES
Assuming that $p_i \neq p_j$ you just apply the formula;
$$\epsilon_i(p_i,I,P) =-\dfrac{\partial d(p_i,I,P)}{\partial p_i}\dfrac{p_i}{d(p_i,I,P)} \\ = -\left( \frac{-\sigma p_i^{-\sigma-1} I}{P^{1-\sigma}} \right)\frac{p_i}{\frac{p_i^{-\sigma} I}{P^{1-\sigma}}} =\sigma$$.
The way how you gave the problem neither $P$ or $I$ contain $p_i$ so you treat them as constants during differentiation.