We have used ab initio simulations to study the doping efficiency of amorphous semiconductors, in particular of B-doped amorphous Si. We have found that even in the optimum case of substitutional doping in dangling-bond free amorphous Si the holes provided by B atoms do not behave as free carriers. Instead, they are trapped into regions with locally distorted bond angles. Thus, the effective activation energy for hole conduction turns to be the hole binding energy to these traps. In the case of high B concentration, the trap states move deeper in the gap and the binding energy and spatial localization of holes increase. In addition, B atoms have lower energies for shorter bond lengths, configurations favored in the vicinity of these traps.