We derive the Varshamov--Gilbert and Hamming bounds for packings of spheres (codes) in the Grassmann manifolds over $\mathbb R$ and $\mathbb C$. The distance between two $k$-planes is defined as $\rho(p,q)=(\sin^2\theta_1+\dots+\sin^2\theta_k)^{1/2}$, where $\theta_i, 1\le i\le k$, are the principal angles between $p$ and $q$.