NOVELTY - Production of carbon molecular sieve membrane involves forming films or hollow fibers made of polyimide polymer or copolymer to produce precursor membrane, and pyrolyzing the precursor membrane under predetermined conditions. The polyimide polymer or copolymer contains repeating units of dianhydride-derived unit and diamine-derived unit. Each dianhydride-derived unit is dianhydride-derived moiety (I) or (II). Each diamine-derived unit is diamine-derived moiety (I-A)-(I-H). At least 50% dianhydride-derived units are dianhydride-derived moiety (I).    USE - Production of carbon molecular sieve membrane used in separation of gas e.g. carbon dioxide/methane, oxygen/nitrogen, and cyclopropane/propane.    ADVANTAGE - The carbon molecular sieve membranes has high permeability and selectivity of gas.    DETAILED DESCRIPTION - Production of carbon molecular sieve membrane involves forming films or hollow fibers made of polyimide polymer or copolymer to produce precursor membrane, and pyrolyzing the precursor membrane under predetermined conditions. The polyimide polymer or copolymer contains repeating units of dianhydride-derived unit and diamine-derived unit. Each dianhydride-derived unit is dianhydride-derived moiety of formula (I) or (II). Each diamine-derived unit is diamine-derived moiety of formula (I-A)-(I-H). At least 50% dianhydride-derived units are dianhydride-derived moiety (I). At least 50% diamine-derived units are diamine-derived moiety (I-A) or (I-B).    R=group of formula (I-1)-(I-4);    Z=group of formula (I-5)-(I-9);    X,X1-X8=H, aryl or linear or branched 1-6C alkyl;    Ra=linear or branched 1-6C alkyl containing terminal hydroxyl, terminal carboxylic acid group, or terminal -C=C-;    Z'=group of formula (Ia)-(Id);    Z"=group of formula (IV) and (V);and    X9=H, linear or branched 1-6C alkyl or linear or branched 1-6C pefluoroalkyl.    (i) When at least 50% diamine-derived units are diamine-derived moiety (I-A), at least one of X1-X4 is 2-6C linear or branched alkyl or aryl; and (ii) When at least 50% diamine-derived units are diamine-derived moiety (I-B), at least one of X5-X8 is 2-6C linear or branched alkyl or aryl.