There is a result that claims: If $X$ is a Stein manifold and $H^2(X,\mathbb{Z})=0$ then for any divisor $D$ there is a meromorphic function $f$ such that $(f)=D$.
What happens if $H^2(X,\mathbb{Z})\neq 0$ ? Is there any divisor that can not be of the form $(f)$ for some meromorphic function?
Thanks
It is well known as the Cousin problem II.
If $M$ is a Stein manifold of dimension $n$, the exact sequence of sheaves $$0\to\mathbb Z\to \mathcal O_M\to \mathcal O^*_M\to 0$$ yields a morphism of groups in cohomology (part of a long exact sequence) $$H^1(M,\mathcal O_M)\to H^1(M,\mathcal O^*_M)\to H^2(M,\mathbb Z)\to H^1(M,\mathcal O_M).$$
We have $H^1(M,\mathcal O_M)$ and $H^2(M,\mathcal O_M)$ both vanish thanks to Cartan's theorem B. Since $H^1(M,\mathcal O^*_M)$ can be identified to $Pic(M)$, the group of line bundles on $M$, we get the isomorphism $$c_1:Pic(M)\to H^2(M,\mathbb Z).$$
We then absolutely have $Pic(M)=0,$ thus any line bundle $\mathcal O(D)$ corresponding to the divisor $D$ is trivial.
Due to a classical result, a divisor $D$ is principal iff $\mathcal O (D)$ is trivial (A), we are done.
If $H^2(M, \mathbb Z)\neq 0$, we absolutely can find a non-principal divisor $D$ when $\mathcal O(D)$ is not trivial thanks to (A).