The invention relates to a preparing method for pirfenidone. The method includes the steps that under the action of an acid catalyst, 2-pentenenitrile is used for reacting with trimethyl/triethyl orthoformate to generate 2-methyl-1-alkoxy-4-cyano-1,3-butadiene (II), and 2-methyl-1-alkoxy-4-cyano-1,3-butadiene (II) and aniline are condensed and then hydrolyzed to obtain pirfenidone. The used raw materials are low in price and easy to obtain, the process flow is short, and the preparing method is easy to operate, environmentally friendly, high in reaction selectivity and high in product yield and purity.