We study spherically symmetric geometries made of anisotropic perfect fluid based on general relativity. The purpose of the work is to find and classify black hole solutions in closed spacetime. In a general setting, we find that a static and closed space exists only when the radial pressure is negative but its size is smaller than the density. The Einstein equation is eventually casted into a first order autonomous equation on two-dimensional plane of scale-invariant variables, which are equivalent to the Tolman-Oppenheimer-Volkoff (TOV) equation in general relativity. Then, we display various solution curves numerically. An exact solution describing a black hole solution in a closed spacetime was known in Ref. [1], which solution bears a naked singularity and negative energy era. We find that the two deficits can be remedied when $rho+3p_1>0$ and $rho+p_1+2p_2< 0$, where the second violates the strong energy condition.