Membrane technology, a successful technology for separating gases such as CO2/CH4 mixture, has attracted much attention because of its low energy consumption, and membrane performance is an important factor affecting its industrial application. Herein, the solvent-induced microstructure of a polyimide membrane was employed to enhance its CO2/CH4 separation performance. The effect of solvents on the membrane structure and gas separation performance was investigated by using different solvents (such as tetrahydrofuran, N,N-dimethylacetamide) to dissolve a newly synthesized polyimide polymer, which was fabricated into a membrane. Various characterization methods, such as positron annihilation lifetime spectroscopy (PALs) and X-ray diffractometry (XRD), were conducted to reveal changes in the microstructure of membranes prepared with different solvents. The interaction of solvents with groups of polymer backbones was also analyzed for the explanation of the effect of solvents on the membrane performance for the separation of different gas pairs, such as CO2/CH4 mixture. The results showed that a membrane with optimal separation performance was obtained by optimizing the solvent composition, which exceeded the 2018 mixed-gas CO2/CH4 upper bound. The induced effect of solvents on the polymer membrane structure provides a new research path for the optimization of polymer membranes to enhance separation performance.