The creation of any work of art is tricky. If everything meshes, it’s magic. But if one key element is off, it’s just an interesting experiment.

This week marks the 60th anniversary of “My Fair Lady,” which opened March 15, 1956, at Broadway’s Mark Hellinger. Theater lovers consider it one of the few perfect musicals, because every piece worked. And while nobody would question the talents of Rodgers & Hammerstein, Mary Martin, Cary Grant and Doris Day, it’s probably a good thing that they never became a part of “My Fair Lady,” though all of them were possibilities.

The “Oklahoma!” composers, Broadway star Martin, and Noel Coward flirted with the idea of the stage musical, but the deals never happened. In 1955, Variety reported that “Lady Liza,” a musical adaptation of George Bernard Shaw’s “Pygmalion,” was being targeted for a Broadway debut the following year. Alan Jay Lerner and Frederick Loewe had pursued the rights for years but were flummoxed by the challenges: It had no traditional love story, no comic subplots, and no big scenes for a singing-dancing chorus.

But then the songwriting duo realized that the solution was not to re-think Shaw’s play, but to embrace it. Huge chunks of dialogue and entire scenes were taken verbatim from the 1913 original. One of the reasons the show endures is the book; while many musicals of that era have dated badly because they depicted the battle of the sexes in 1950s terms, Shaw’s observations about men and women were shockingly advanced for any era.

On Feb. 29, 1956, producer Herman Levin persuaded CBS to foot the entire $360,000 production cost, with the understanding that it would eventually become a TV special. As a bonus, the network helped hawk the show, via $4,800 worth of local TV ads each week.

When it opened on Broadway the following month, Variety reviewer Hobe Morrison raved, “Virtually everything is superlative, for this is one of those bewitching occasions when everything seems to fall into place.” The album topped Billboard charts eight consecutive weeks, and popped up again to the No. 1 spot another seven times in the following three years. The show ended up giving 2,717 performances on Broadway.

The play’s huge success — it was the “Hamilton” of its era — meant CBS and the production team rejected the idea of a TV special, aiming for the bigscreen. A few months after the Broadway opening, Variety reported that bidding for the film rights would start at a whopping $1 million. Among the bidders: Doris Day and her husband Marty Melcher, who saw it as a perfect screen vehicle for her.

But nobody was in a rush for a film, since the stage version was raking in the dough, with sell-out performances on Broadway, in the West End, touring companies and foreign-language versions. CBS had a 40% stake, and the other 60% went to Levin, Lerner, Loewe, director Moss Hart and others. (At a press conference, Rex Harrison sadly admitted that he earned a salary from the show, but no percentage.) By 1959, the show had earned $11 million.

Finally, in 1961, Variety reported that Warner Bros. had bought film rights for a record $5.5 million. Among the stars considered were Cary Grant as Henry Higgins and James Cagney as Alfred P. Doolittle. In the end, Rex Harrison and Stanley Holloway re-created their stage roles and the role of Eliza Doolittle went to Audrey Hepburn, who was paid $1 million (the second star to receive that salary, after Elizabeth Taylor in “Cleopatra”).

The film earned 12 Oscar nominations, but none for Hepburn. Since “Mary Poppins” opened that same year and made a star of Julie Andrews, many in the press blamed Hepburn for “stealing” the role from Andrews. But, in fact, Hepburn had been considered for the stage version back in the 1950s, after becoming a Broadway sensation in “Gigi” (1951) and “Ondine” (1954). And while the dubbed-in Marni Nixon voice is sometimes jarring, Hepburn’s expert acting has gained admirers over the years; along with “Roman Holiday” and “Breakfast at Tiffany’s,” “My Fair Lady” became one of Hepburn’s signature roles.

The film’s eight Academy Awards were capped by its prize for best picture, which gave the 1964 film another interesting distinction: It was the last best-picture Oscar winner to be filmed entirely on soundstages.