According to the Catholic Encyclopedia’s List of Popes, there have been several occasions where there was no pope in the Papacy.
Usually this was for some political reason, namely infighting among the church bishops themselves, or struggles between the Roman government and the church.
Take, for example, the papal election of 1241. Pope Gregory IX died while struggling for power against the Holy Roman Emperor Frederick II.
Roman Senator Matteo Orsini wanted to force the College of Cardinals into picking a pope of his choosing, and quickly, so he had the cardinals locked into a dilapidated Roman temple. The windows were boarded up, there wasn’t enough furniture to go around, and only small portions of food were shoved under the door.
Weeks passed, and the cardinals still refused to bend to Orsini’s wishes. To pressure them further, Orsini ordered that his guards use the roofs holes as their personal toilets, making the cardinals’ meeting room pretty unbearable.
When an English cardinal fell sick and died, Orsini refused to take the body away. The body was left in the room with the remaining cardinals.
In the course of 66 days, two more cardinals died from the harsh conditions. Finally, the survivors chose an extremely sick man from their midst, Godfrey of Sabina, as Pope Celestine IV, just to get the process over with.
As expected, he died very soon afterward-17 days into the papacy, quite possibly as a result of the ordeal. However, the cardinals were no fools.
They absolutely refused to return to Rome to pick a new pope and simply left the office empty for two years.