Hard pimples on vagina

I get these hard pimples on my vagina usually after I shave and they hurt when I touch them, I'm not sexually active so it can't be because of anything like that. They usually take about 2-3 weeks to go away, Have any of you got this before? Or know how to prevent this or get rid of it faster?