I have decided to use "frumpy" as a blanket term to discuss the appearance typically associated with a librarian. This includes: older woman, hair worn in a bun, cardigans, glasses, and generally unfashionable. Another term that could have been used is "spinster" and because the woman is now too old to appeal to single men, she's also too old to look attractive and sexually viable; being attractive is only for the young stereotypically speaking. Presentations in media are varied and a few examples are as follows.
King of Queens, created by Michael Weithorn and David Lit 1998-2007
Season 4; Episode 21: "The Bun Dummy"
Leah Remini plays Carrie Heffernan a legal secretary and wife. In the episode “The Bun Dummy” Carrie discovers the ever versatile, comfortable, easy hairstyle: the bun and begins to wear it all the time to work, to the gym, around the house and even to her husband’s high school reunion. Her husband Doug comments several times about how he doesn’t like her hairstyle and that it reminds him of a librarian or an old lady. When they are at Doug’s reunion, they pay tribute to Mrs. Palsgraf, their former high school librarian that recently passed away. The image is of an older woman, hair in a bun, sharp face, and wearing glasses. Carrie immediately takes her hair out of the bun, reinforcing the negative image associated with the librarian “look”. No one wants to look like a librarian.
The Middle created by Eileen Heisler and DeAnn Heline 2009-present
"Average Rules" Season 1: Episode 24
Betty White guest stars as Mrs. Nethercott, the librarian working at Brick’s elementary school. She is an older woman who wears a cardigan and glasses; however, she appears slightly different from the other examples in that she has a “nice” face and does not wear her hair in a bun. While she represents some of the stereotypes related to how a librarian looks, she does not possess them all and looks more like a “normal, sweet, older lady” that happens to work at the library. This is probably due to the example being much more modern as the episode aired in 2010. It is not a complete break from the stereotype, but it is a step in the right direction.
Shadow of a Doubt 1943, directed by Alfred Hitchock
Mrs. Cochran, played by Eily Malyon, is a librarian at the public library. She is an older woman, with a sharp, unfriendly face, hair pulled up in a bun, and wearing a frumpy, ill-fitting dress that looks more like a bathrobe. Mrs. Cochran fits squarely in the stereotype of what a librarian looks like save a pair of glasses. The movie was released in 1943 and so that speaks to why the librarian is portrayed in this way. However, it does not excuse the modern depictions with the same attributes as seen in the King of Queens example above.