If you are misremembering about the squash, then this is almost certainly Ray Bradbury's "All Summer in a Day."
The story is about a class of students on Venus, which, in this story, is a world of constant rainstorms, where the Sun is visible for only one hour every seven years. (This story was written before Mariner 2 discovered that the surface temperature on Venus is higher than the boiling point of water.)
One of the children, Margot, moved to Venus from Earth five years earlier, and she is the only one in her class to remember sunshine, since the Sun shone regularly on Earth. She describes the Sun as "a penny", or "like a fire in the stove", and relays in a poem to the class that "I think the sun is a flower,That blooms for just one hour". The other children, being too young ever to have seen it themselves, do not believe her. The other students bully and ostracize her, and just before the sun comes out, they lock her in a closet down a tunnel.
As the Sun is about to appear, their teacher arrives to take the class outside to enjoy their one hour of sunshine and, in their astonishment and joy, they all forget about Margot. They run, play, skip, jump, and prance about, savoring every second of their newly found freedom. "It's much better than sun lamps!" one of them cries.
Suddenly, a girl catches a raindrop in her hands. Thunder sounds, and they start to pick as many flowers as they can before it starts pouring again and run back inside. At this point, one of them remembers Margot, who is still locked in the closet. Ashamed, they let her out of the closet, standing frozen, embarrassed over what they have done and unable to "meet each other's glances."
The precious Sun has come and gone, and because of their despicable act, Margot, who loved the Sun the most, has missed it.
It is available online, and you can read and check whether this is what you were thinking of. "All Summer in a Day" is one of the most well-known science fiction stories of all time.