We compare the WMAP temperature power spectrum and SNIa data to modelswith a generalized Chaplygin gas as dark energy. The generalized Chaplygingas is a component with an exotic equation of state, pX = −A/ραX(a polytropic gas with negative constant and exponent). Our main resultis that, restricting to a flat universe and to adiabatic pressureperturbations for the generalized Chaplygin gas, the constraints at95% CL to the present equation of state wX = pX/ρX and to the parameter α are −1 ⩽ wX < −0.8, 0 ⩽ α < 0.2, respectively. Moreover, we show that a Chaplygin gas (α = 1) is ruled out as a candidate for dark energy by our analysis at morethan the 99.99% CL. A generalized Chaplygin gas appears much less likely as a unified dark matter candidate (ΩCDM = 0) than as a dark energy model,although its χ2 is only two sigma away from the expected value.