Corollary (open mapping theorem on Riemann surfaces)
Any non-constant analytic map $f: X\to Y$ between Riemann surfaces is open, i.e. sends open sets to open sets.
If $X$ is compact, then $f(X)$ is both open and closed, so $f$ is surjective by the connectedness of $Y$. Hence if $Y$ is not compact, then there is no non-constant analytic map $f: X\to Y$.