It’s possible you need to free one or more characters from what they are doing (and this is true for other buildings, as well). Be careful of rushing characters into new tasks, as you may delay starting the tasks that move you on in the game.

All buildings have a trigger event. Building the library happens after you have built the treehouse, and Bart has skateboarded and skipped school. Skinner needs to be free because he prompts the build (with Bart and Lisa).

Here’s a very useful link. It contains a list of all the buildings and who you need to have free to start building them: