The following is a fundamental result in complex analysis (see the books of Ahlfors or Rudin).
Theorem. Let $f$ be a holomorphic function on a region $\Omega$; then $f$ has an antiderivative on $\Omega$ if and only if
$$
\int_\gamma f(z)\,dz=0
$$
for every closed path in $\Omega$.
(A region is an open and connected subset of the complex plane).
Since the integral you're considering is not zero, it follows that $1/z$ has no antiderivative on a region $\Omega$ that contains a circle centered at $0$, because the integral over this circle is $2\pi i\ne 0$.
It is also well known and basic in complex analysis that the integral of a holomorphic function on a contractible path is zero, so the result follows that a holomorphic function defined on a simply connected region has an antiderivative. So, for instance, $1/z$ does have an antiderivative on a region obtained from the complex plane by removing a ray with origin at $0$ (the main branch cut of the complex logarithm is defined as the antiderivative of $1/z$ over the region obtained by removing the nonpositive real numbers).
On the other hand, simple connectedness is only a sufficient condition; for example, the function $1/z^2$ has an antiderivative on $\mathbb{C}\setminus\{0\}$, which is a non simply connected region.