RIO DE JANEIRO — Vaccine supplies are running out. The number of daily deaths has reached a record high. A new variant that health officials say is three times as transmissible as the original coronavirus is spreading throughout the country. Some are calling for more lockdowns.

But people can’t bring themselves to stop partying.

Brazilians, a famously jovial and festive people, have struggled with restrictions on gatherings since the start of the pandemic. But the challenge has never been more clear than this week, when Rio de Janeiro filled with revelers to celebrate the annual bacchanal of Carnival — despite the fact that Carnival was canceled. In the face of clear obstacles — beefed-up police forces, the threat of tickets, events called off, a disease that has killed 240,000 Brazilians and counting — people have found both the will and the way to party.

In clubs and on the streets, the scene has been the same: dense crowds, dancing, drinks — masks nowhere to be seen. It’s Carnival without the Carnival.

In a normal year, weeks of parties would have crescendoed with masses in the streets from Monday through noon Wednesday. This year, party promoters are doing what they can to avoid detection. Word of the bashes is spreading on WhatsApp and Telegram, encrypted social media networks. A party’s location breaks only hours before it starts. Sometimes the subterfuge has been successful. Sometimes not. Police have closed down dozens of gatherings.

“The biggest challenge are the people,” Brenno Carnevale, Rio’s secretary of public order, told the newspaper O Globo. “Sometimes, during the busts, we’re seeing great hostility against agents. Glass bottles are being thrown. People arrested for contempt.”

“To disperse a crowd that’s drinking alcohol, in a context like this, is no trivial thing.”

Brazilians celebrate Carnival despite the fact that Carnival was canceled because of the pandemic. (Lionel Ceschin)

For Lionel Ceschin, 34, Rio’s Carnival in Rio — traditional Brazil’s biggest — was unlike any he had seen. He had contracted the virus after partying with friends on the beach over New Year’s Eve and was seriously ill for weeks, losing about 15 pounds.

But by last week, he was feeling better. Equipped with his antibodies, he boarded a flight from the city of Curitiba for Rio.

He bought a ticket to a party online, but was told only a meeting point. There, buses transported the revelers to an undisclosed location in Guaratiba, on the far outskirts of the city. Inside the venue were more than 1,000 people, he said. Almost no one wore a mask.

“There were definitely people infected there,” he said. “And people definitely got the virus there.”