A series of polyimide composites with various mass fractions of multi-walled carbon nanotubes (MWNTs) were prepared by in situ polymerization. MWNTs were treated with an acid mixture and sulfoxide chloride in turn to increase the chemical compatibility of carbon nanotubes with the polyimide matrix. The modified MWNTs are dispersed homogeneously in the matrix while the structure of the PI and MWNTs structures are stable in the preparation process. The composite films hold preferable thermal stability as same as the pure PI. The dielectric constants of the composites decreased with the increasing frequency and increase sharply with the adding of MWNTs.