This happends quite often to me. I remember back when I was in school, if I ever saw a teacher outside of classes, I'd always try my best to avoid them and not make eye contact. But I'm sure that's natural for most students.
These days, if I'm not in a good mood or just want to go about my business, I'll just avoid someone, if possible. Last month I spent most of my weekdays at a local library doing my job search on my laptop. I specifically went to a library a while away from my area so I WOULD NOT have the issue of running into someone I know. But of course, I end up seeing an old friend there. I saw her, but I don't think she ever saw me. She ended up there at least 5-6 different times, and I just avoided her. Not because I didn't like her, but I just didn't feel up to answer any personal questions that most people ask when you see someone.