We present the stellar populations of compact elliptical galaxies (cEs) in different local environments. Following the conventional selection criteria of cEs with low luminosity (Mg > -18.7 mag), small effective radius (Reff < 600 pc), and high-velocity dispersion (> 60 km s-1), we selected 138 cE candidates in the redshift range of z < 0.05 using the Sloan Digital Sky Survey (SDSS) DR12. We divided our cEs into two subsamples, namely cEs with (cEw) and without (cEw/o) a host galaxy, which are inside and outside of one virial radius of the nearby bright (Mr < -21 mag) galaxy, respectively. We investigated the stellar population properties (age, metallicity, and [α/Fe]) of cEs based on the Lick line indices extracted from SDSS spectra. The metallicity distributions between the two subsamples show a strong difference, in which cEw has a systematically higher mean metallicity than cEw/o. In the mass-metallicity distribution, cEw deviates from the relation observed for early-type galaxies at a given stellar mass, whereas cEw/o conforms to the relation. We also observed a hint of a difference in the [α/Fe] distributions between cEw and cEw/o, in which cEw has a slightly higher mean value of [α/Fe] than cEw/o. In the case of age distribution, no statistically significant difference was found between cEw and cEw/o. Based on the different features in the stellar populations of cEw and cEw/o, we can propose two different cE formation channels tracing different original masses of the progenitors. cEw would be the remnant cores of the massive progenitor galaxies whose outer parts are tidally stripped by a massive neighboring galaxy (i.e., nurture origin). In contrast, cEw/o are likely the faint end of early-type galaxies maintaining in-situ evolution in an isolated environment with no massive galaxy nearby (i.e., nature origin). Our results reinforce the propositions that cEs comprise a mixture of galaxies with two types of origins depending on their local environment.