The end of cars that run on petroleum may now be in sight.

Think 2050, the middle of this century.

The latest strong signal of the turn away from the internal combustion engine toward cleaner electric motors is coming from the UK.

The British government announced last week it will ban the sale of new gas and diesel cars by the year 2040.

The move comes just weeks after Francemade the same call. Other countries including Norway, the Netherlands and India have set or are considering similar goals along with a number of big cities around the world, including Paris, Mexico City and Athens.

The UK government says its ban will apply to cars that run only on gas or diesel. That means speeding up the transition over the next couple of decades to hybrids, which run on both petroleum and electricity, as well as cars that run on electricity alone.

Such cars currently represent a tiny segment of the car market in the UK and around the world, although it is growing rapidly.

Related: Volvo leads the global car industry toward an electric future

Most drivers of this new breed of cars have made the switch largely out of a desire to cut their emissions of climate-warming carbon dioxide. But the moves in the UK, France and elsewhere to phase out gas- and diesel-powered cars is largely in response to a more local and immediate problem: old-fashioned smog from tailpipe emissions that make people sick.

Smog is still a big problem in many cities in Europe and elsewhere, and governments are under pressure to fix it.

In recent years many European countries had put their faith in fighting smog in what some car makers called "clean diesel" engines that promised much lower emissions than gas engines.

But that dream has been largely killed by the VW scandal of the last couple of years, after the German auto giant was caught rigging millions of their diesel engines to make them appear cleaner than they really are.

Now, without "clean diesel," a lot of governments and even car companies are trying to make a quick pivot toward electricity.

The switch will require big changes in technology and infrastructure, though, which explains the long transition period governments are setting up.  

The two biggest limitations right now are range — how far a battery-powered car can go on a charge — and access to charging stations — like gas stations but pumping electrons instead of liquid fuel.

Among countless other possible buyers, these challenges have discouraged The World’s own Jason Margolis.

Margolis owned one of those tainted VW diesels, and when the company bought it back, he was looking to put the money toward an electric.

But he ultimately decided not to. The one he had his eye on could only go about 83 miles on a charge.

“I thought I was fine for commuting back and forth to work,” Margolis says, “but I was a little concerned [that you] can't really do much else beyond that. And the second issue was, where do you charge it?”

Margolis says the charging cable that came with the car he wanted was 20 feet long but the closest he could get a car to his house was 22 feet — “2 feet shy of making it happen,” he says. There’s also no charging station at The World’s home base at WGBH in Boston, and he wasn’t sure he’d be able to find any public charging stations.

It’s a concern shared by many. Right now, at the dawn of the electric age in Britain, there are fewer than 5,000 charging stations in a country of more than 36 million vehicles, according to Agence France-Presse, potentially creating a lot of anxiety for drivers who might otherwise make the switch.

“People are reluctant to buy an electric car until they see those charging stations out there,” says Dan Sperling, director of the Institute of Transportation Studies at the University of California, Davis.

But Sperling thinks that problem is more psychological than actual.

“The reality is, most people are going to be charging, number one at home, [and] the second place is at work,” Sperling says. “So the next campaign is to get employers to put in chargers. And public charging is really the third priority.”

Sperling is also confident the range issue will be worked out as manufacturers find ways to squeeze more batteries into all-electrics and plug-in hybrids come into broader use.

The bigger issue, Sperling says, is cost — batteries for electric cars are still expensive, making the price of an average electric car a good deal steeper than a gas counterpart.

“That’s probably the more important factor,” Sperling says. “The costs of these vehicles have to come down and be competitive. But I think we're going to see steady reduction in battery cost.”

Along with plug-in hybrids, Sperling points to a third emerging technology that he believes will be part of the global switch away from purely petroleum-powered cars: electric cars powered not by a battery but by ahydrogen fuel cell.

“I own a hydrogen fuel cell car myself,” Sperling says. “I get about 300 miles of range before I have to refuel it.” And like a battery-electric, Sperling says, it produces zero emissions.

Hydrogen-powered cars are already available in California and a few other markets, although, as of now, drivers face an even more limited availability of refueling options than drivers of battery-electrics. But Sperling believes they will become an important part of the mix as the world begins to speed away from petroleum-powered cars.

Related: The car of the future — the very near future — might be driven by the wind

From PRI's The World ©2017 PRI