  The perfect fluid cosmology in the 1+d+D dimensional Kaluza-Klein spacetimes
for an arbitrary barotropic equation of state $p= n \rho$ is quantized by using
the Schutz's variational formalism. We make efforts in the mathematics to solve
the problems in two cases. For the first case of the stiff fluid $n=1$ we
exactly solve the Wheeler-DeWitt equation when the $d$ space is flat. After the
superposition of the solutions we analyze the Bohmian trajectories of the
final-stage wave-packet functions and show that the flat $d$ spaces and the
compact $D$ spaces will eventually evolve into finite scale functions. For the
second case of $n \approx 1$, we use the approximated wavefunction in the
Wheeler-DeWitt equation to find the analytic forms of the final-stage
wave-packet functions. After analyzing the Bohmian trajectories we show that
the flat $d$ spaces will be expanding forever while the scale function of the
contracting $D$ spaces would not become zero within finite time. Our
investigations indicate that the quantum effect in the quantum perfect-fluid
cosmology could prevent the extra compact $D$ spaces in the Kaluza-Klein theory
from collapsing into a singularity or that the "crack-of-doom" singularity of
the extra compact dimensions is made to occur at $t=\infty$.
