All of these examples involve a bit of cleverness, so I thought I'd point out a more straightforward way to construct counterexamples. If $X$ is any space, we can build a space $X' = K(\pi_0 X, 0) \times K(\pi_1 X, 1) \times K(\pi_2 X, 2) \times \dots$ which has the same homotopy groups as $X$, but which is usually not weakly equivalent to $X$. Pretty much any invariant of spaces other than the homotopy groups will distinguish them. For instance, if $X = S^2$, then $H_3(X) = 0$, but $X'$ contains $K(\pi_3 S^2, 3) = K(\mathbb{Z}, 3)$ as a retract, so $H_3(X')$ contains $H_3(K(\mathbb{Z}, 3)) = \mathbb{Z}$ as a retract and cannot be $0$.
Of course, this doesn't produce geometrically nice spaces like smooth manifolds.