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$X$ is any space, we can build a space X' = K(π0X, 0) × K(π1X, 1) × K(π2X, 2) × ...$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$X$, but which is usually not weakly equivalent to X$X$. Pretty much any invariant of spaces other than the homotopy groups will distinguish them. For instance, if X = S2$X = S^2$, then H3(X) = 0$H_3(X) = 0$, but X'$X'$ contains K(π3S2, 3) = K(Z, 3)$K(\pi_3 S^2, 3) = K(\mathbb{Z}, 3)$ as a retract, so H3(X')$H_3(X')$ contains H3(K(Z, 3)) = Z$H_3(K(\mathbb{Z}, 3)) = \mathbb{Z}$ as a retract and cannot be 0$0$.
Of course, this doesn't produce geometrically nice spaces like smooth manifolds.