Why are pumpkins associated with Halloween?

Lanterns were carved from these plentiful gourds.