We investigated whether or not the stellar initial mass function of early-type galaxies depends on their host environment. To this purpose we selected a sample of early-type galaxies from the SPIDER catalogue (La Barbera et al. 2010), obtained information on their environment through the group catalogue of Yang et al. (2007) and used the optical SDSS spectra of these galaxies to determine the line strength of IMF sensitive indices, from which to derive the IMF slope. To reach a high enough signal-to-noise, we stacked the spectra in velocity dispersion (σ0) bins, on top of separating the sample by galaxy hierarchy and host halo mass, a proxy of their environment. We then compared the observed line strengths with predictions from the MIUSCAT/EMILES synthetic stellar population models to constrain the best fitting slope of the IMF (Γb) in the stacked spectra. We also explored how results depend on different sets of isochrones and the way elemental abundance ratios are fitted. We find that Γb increases with σ0 and becomes bottom-heavy at high σ0. No dependence of Γb on environment or hierarchy is detected, except possibly when low σ0 centrals in low and high mass haloes are compared. This feature is likely a combined effect of an age-dating technique and of a contamination due to telluric absorption lines, but further investigation is required.