Farmer villagers not spawning
Solution 1:
Villagers are all randomly assigned a profession on spawning, and unfortunately, this is an even 1/6 chance for each one. For specifically Farmers (so you can trade) this is then further broken down to the 4 different brown coat professions, ultimately making the chance of a Farmer spawning only 4.17%. Source.
Fortunately, it would appear that baby villagers are also assigned their professions at random, so it is entirely possible to create a Villager Breeder in order to find the Villager you are after, or simply boost the amount of doors you have in your village. Even by simply creating a 3 wide covered platform with in the village, and fill that with doors will greatly increase your villager breeding rate.