We explicitly compute the first and second cohomology groups of the classical Lie superalgebras slm|n and osp2|2n with coefficients in the finite dimensional irreducible modules and the Kac modules. We also show that the second cohomology groups of these Lie superalgebras with coefficients in the respective universal enveloping algebras (under the adjoint action) vanish. The latter result in particular implies that the universal enveloping algebras U(slm|n) and U(osp2|2n) do not admit any non-trivial formal deformations of Gerstenhaber type.