When the water is to be removed, it is sufficient to conduct the reaction using an azeotropically dehydratable solvent such as toluene, xylene or the like and a means such as a Dean-Stark tube capable of allowing the reaction to proceed while removing water from the system or the like.