A method for preparing a traditional Chinese medicine micro-ecology oral preparation for preventing ascariasis comprises the steps of preparing euphorbia helioscopia, azedarach, kaladana, kaladana, pumpkin seeds, pomegranate bark, coptis chinensis, gynostemma pentaphylla, astragalus membranaceus, codonopsis pilosula and radix glycyrrhizae; conducting superfine grinding on all the traditional Chinese medicines, adding an ethanol solution, boiling with strong fire, keeping warm with slow fire, conducting cooling and filtering, concentrating filter liquor, adding white sugar, boiling, cooling to the normal temperature, inoculating lactobacillus, tea fungus and acetobacter xylinum, and obtaining white fungus blocks after fermentation is conducted for 96-118 h; conducting dilution with the proportion of the white fungus blocks to bacterial liquid being 1 to 50-80, conducting secondary fermentation for 18-24 h, and obtaining the micro-ecology oral preparation. The traditional Chinese medicine micro-ecology oral preparation can increase the number of effective microbial communities in the intestinal tract, improve immunity and improve the disease resistance of pigs. The oral preparation has the advantages that preventing effect is good, cure rate reaches 90.0%, preparing method is simple, viable content is high, using is convenient, environment friendliness is realized, and no residue exists.