I used to get this, and still do sometimes. Try repositioning your hands; they might be either too close together or too far apart, too high or too low.—Make sure they are a little wider than the shoulders and at the same height as your shoulders. There’s also push up bars but I doubt that’s worth the trouble just for pe class unless your teacher has some lying around.
If that doesn't work then you could try talking it over with your pe teacher after class. I had friends that wouldn't do push ups in class. If it hurts then you probably shouldn’t do it anyways, especially if it’s just pe class. And normally people don’t question it if you say you have wrist problems- or at least I never did.