NOVELTY - Producing methanol comprises: providing source of syngas; passing syngas to loop; withdrawing purge stream (212); providing first membrane with e.g. first feed side; passing purge stream across first feed side; withdrawing hydrogen-rich first permeate stream; withdrawing hydrogen-depleted first residue stream (217); providing second membrane with e.g. second feed side; passing first residue stream across second feed side; withdrawing carbon dioxide-depleted second residue stream (221); withdrawing carbon dioxide-enriched second permeate stream (220); and passing second permeate stream to loop.    USE - The process is useful for producing methanol.    ADVANTAGE - The process provides: improved methanol product yield with reduced compressor power requirements; and recovering carbon dioxide from the purge gas and recycling it back to the synthesis loop, which results in additional methanol production and sequestration of carbon dioxide, thus preventing its release to the environment.    DETAILED DESCRIPTION - Producing methanol comprises: providing a source of syngas, where the syngas has a first composition parameter (R1) which is greater than 2; passing the syngas to a methanol synthesis loop to produce a condensed methanol product stream (208); withdrawing a purge stream (212) from the methanol synthesis loop to limit the concentration of inerts and excess hydrogen; providing a first membrane having a first feed side and a first permeate side, where the first membrane exhibits a selectivity to hydrogen over carbon dioxide of at least 5, and a selectivity to hydrogen over carbon monoxide of at least 20; passing at least a portion of the purge stream across the first feed side; withdrawing a hydrogen-rich first permeate stream from the first permeate side, where the first permeate stream has a second composition parameter (R2) which is less than R1; withdrawing a hydrogen-depleted first residue stream (217) from the first feed side; providing a second membrane having a second feed side and a second permeate side, where the second membrane is selective for carbon dioxide over hydrogen and methane; passing the first residue stream across the second feed side; withdrawing a carbon dioxide-depleted second residue stream (221) from the second feed side; withdrawing a carbon dioxide-enriched second permeate stream (220) from the second permeate side, where the second permeate stream has a third composition parameter (R3) which is less than R2; and passing the second permeate stream to the methanol synthesis loop.    DESCRIPTION OF DRAWING(S) - The figure shows a schematic drawing for methanol production process.    Product stream (208)    Purge stream (212)    Hydrogen-depleted first residue stream (217)    Carbon dioxide-enriched second permeate stream (220)    Carbon dioxide-depleted second residue stream (221)