The differential cross-section for the inclusive production of ψ(2S) mesons in pp collisions at s√=7 TeV has been measured with the LHCb detector. The data sample corresponds to an integrated luminosity of 36 pb−1. The ψ(2S) mesons are reconstructed in the decay channels ψ(2S)→μ + μ − and ψ(2S)→J/ψπ + π −, with the J/ψ meson decaying into two muons. Results are presented both for promptly produced ψ(2S) mesons and for those originating from b-hadron decays. In the kinematic range p T(ψ(2S))≤16 GeV/c and 2<y(ψ(2S))≤4.5 we measure where the last uncertainty on the prompt cross-section is due to the unknown ψ(2S) polarization. Recent QCD calculations are found to be in good agreement with our measurements. Combining the present result with the LHCb J/ψ measurements we determine the inclusive branching fraction where the last uncertainty is due to the B(b→J/ψX) , B(J/ψ→μ+μ−) and B(ψ(2S)→e+e−) branching fraction uncertainties.