Some governments privatized chunks of their power industry in the early 1990s when free-market solutions to public-sector problems were in vogue, leaving it unclear who is ultimately responsible for providing power.

Other governments, as in South Africa, failed to build power plants that experts warned were needed. The government monopoly Eskom, the world’s fourth-largest power utility, was advised in a 1998 report that it would run short of power in 2007, but planning and financing problems — not all within the utility’s control — stalled upgrades. The forecast was actually optimistic: Eskom began running short in 2006.

Yet South Africa’s woes pale beside those of Nigeria, Africa’s most populous nation. Only 19 of 79 power plants work, the government said in April. Daily electricity output has plunged 60 percent from its peak, and blackouts cost the economy $1 billion a year, the Council for Renewable Energy in Nigeria says.

Poor management is but one problem. War has devastated the power grid in Congo, in Africa’s heart, and stalled plans to develop its vast hydroelectric potential. In Kenya, Tanzania, Uganda and parts of West Africa, drought has shrunk rivers and slashed the generating capacity of hydroelectric dams. Drought in Ghana, for example, has crippled gold and aluminum production and set off blackouts in Togo and Benin, which buy power from Ghana.

Once a major power exporter, Uganda now blacks out parts of its capital, Kampala, for as much as a day at a time and has leased two 50-megawatt generators, burning diesel at a time of record oil prices. The demand for hydropower in Uganda and its neighbors, with drought, is blamed by some for a steady reduction in the water level of Lake Victoria, Africa’s largest.

Uganda’s gas stations are now short of diesel for vehicles — in part, paradoxically, because power shortages are shutting down a pipeline from Kenya. News reports say the nation has spent enough on diesel-fueled power generation to build two hydroelectric dams.

Image Grace Njobvu, 77, and her grandchildren used candles to light her home in the Matero township of Lusaka, which often experiences blackouts. Credit... Photographs by Benedicte Kurzen for The New York Times

Zambia, where power to customers like Mr. Mwale is rationed almost every day, is a template for such problems. Barely 20 percent of households are wired for power — only 3 percent in rural areas — but the Zambia Electricity Supply Company, known as Zesco, is signing up 10,000 new customers a year, said Christopher Nthala, the utility’s transmission director.