As GrennDayGirl9293 said before me, James was not mature enough or not really Lily's type until later. But it might also be true that Lily herself was not ready for a relationship but in her last years of school. Or maybe she had some fancy of her own earlier in life, and had no eyes for that little brat of a Potter.
