There is also provided according to this invention a process for preparing a polyimide, which comprises reacting an acid dianhydride represented by the formula: ##STR6## wherein Ar is a divalent group containing an aromatic ring; and X is ##STR7## with a compound represented by the formula: ##STR8## wherein Y is an amino group or an isocyanate group; and R1, R2, R3 and R4 represent independently a