Sam Mendes has withdrawn as the director of the incoming Broadway production of “Charlie and the Chocolate Factory,” the musical that he directed in its premiere production in London, where the show is still running.

Mendes, the director of recent James Bond outing “Spectre,” will remain aboard as producer of the project via his company Neal Street Productions, and will also be involved in the final selection of the director to replace him. “Hairspray” director Jack O’Brien is rumored to be the likely choice, but that has yet to be officially confirmed by those involved in the production.

Mendes cited scheduling difficulties as the reason for his exit, and all sides — including lead producer Warner Bros. Theater Ventures — characterize the departure as amicable. “I knew I couldn’t marry the time commitment to make a Broadway production with the development of my next projects for Neal Street,” he said in a statement.

Mendes’ schedule has always been a hurdle to overcome in getting “Charlie” to Broadway, which opened in London in the summer of 2013 but has long targeted a Broadway bow during the 2016-17 season, in part due to the director’s intervening work on the Bond franchise films “Skyfall” and “Spectre.” “Charlie” remains on track for New York in 2016-17, with some creative tinkering likely to be done before then (although what, exactly, will be tweaked under the new director remains to be determined).

“Charlie and the Chocolate Factory” earned mixed reviews when it opened in London, but the family-friendly outing has been selling well enough to keep the musical going for more than two years.

Although reps for “Charlie” wouldn’t confirm the involvement of O’Brien, the director would make an obvious choice for the project. O’Brien has previously worked with “Charlie” songwriters Marc Shaiman and Scott Wittman on both “Hairspray,” the Tony-winning hit that ran on Broadway for six and a half years, and on the shorter-lived musical adaptation of “Catch Me If You Can.”

Producers Warner Bros. Theater Ventures (Mark Kaufman), Langley Park Productions (Kevin McCormick) and Neal Street (Mendes, Pippa Harris, Caro Newling) expect to confirm the new director in the coming weeks, with the exact Broadway timeline still to be locked in.