Updated: After nearly two decades of missteps and mishaps, filming on the latest iteration of Terry Gilliam’s ill-fated “The Man Who Killed Don Quixote” is due to start in October, with former Bond girl Olga Kurylenko added to a new cast that includes Adam Driver and Michael Palin.

Gilliam announced Wednesday that preparation on his pet project would begin next month and would be shot in Spain, Portugal and the Canary Islands, to be finished by Christmas. Portuguese producer Paulo Branco signed up earlier this year on the film, which is budgeted at $19 million.

“I want to get this film out of my life so I can get on with the rest of my life,” a jovial and relaxed-looking Gilliam said at a press conference in Cannes.

He told Variety that the film kept nagging at him despite his having completed other movies in the interim, such as 2013’s “The Zero Theorem.”

“When they finish, ‘Quixote’ comes creeping back through the back of my skull,” he said. “It just won’t go away. I can see the film so clearly, and I think we’ve written a good script, and I hate the idea of that work going for naught.”

The project has suffered a series of misadventures worthy of the man of La Mancha himself. Disasters on set, unexpected illnesses and financial problems have caused production to be canceled or delayed several times since work first started on the movie 18 years ago. Gilliam has cast a succession of actors, including Johnny Depp, Robert Duvall and Ewan McGregor, in the film’s various incarnations.

In the new version, Driver is set to play Toby, a jaded young advertising executive who returns to the Spanish village where, as a student, he made a film based on Cervantes’ masterpiece. The consequences of that film have been catastrophic, and sweep Toby up in a fantastic extravaganza complete with damsels in distress, knights and giants.

Palin, one of Gilliam’s fellow “Monty Python” founders, plays a villager who believes himself to be Don Quixote. Kurylenko plays the wife of Toby’s boss.

Gilliam said he was adjusting the script to better suit his new cast, especially his new young leading actor, who has taken over the role originally played by Depp. Driver has been reading the book and sending Gilliam notes.

“Johnny is so good at creating — I wouldn’t say cartoon characters, but they’re extreme characters. Adam isn’t that kind of guy. He’s more solid, so I alter those,” Gilliam told Variety.

Other alterations are based on current events. “There’s a lot of Muslims in this film suddenly. I react to what’s going on in the world,” he said, adding: “They may or may not be real, just like most of the terrorists in the world.”

As for casting his old pal Palin, Gilliam quipped to reporters: “I thought I’d resurrect him. He’s not quite dead.”

The new version, scheduled for release next year, is expected to showcase the Gilliam-esque flights of fancy seen in the director’s previous films, such as “Brazil” and “Twelve Monkeys.”

The problems besetting Gilliam’s pet project were the subject of their own movie, the well-regarded 2002 documentary “Lost in La Mancha.” Flash floods and the illness of actor Jean Rochefort helped scrap the first attempt at making “The Man Who Killed Don Quixote.” A reboot announced last year was also suspended because of illness, after actor John Hurt received a diagnosis of pancreatic cancer.