In their famous paper on partitions, Hardy and Ramanujan also raised the question of the behaviour of the number $p_s(n)$ of partitions of a positive integer~$n$ into $s$-th powers and gave some preliminary results. We give first an asymptotic formula to all orders, and then an exact formula, describing the behaviour of the corresponding generating function $P_s(q) = \prod_{n=1}^\infty \bigl(1-q^{n^s}\bigr)^{-1}$ near any root of unity, generalizing the modular transformation behaviour of the Dedekind eta-function in the case $s=1$. This is then combined with the Hardy-Ramanujan circle method to give a rather precise formula for $p_s(n)$ of the same general type of the one that they gave for~$s=1$. There are several new features, the most striking being that the contributions coming from various roots of unity behave very erratically rather than decreasing uniformly as in their situation. Thus in their famous calculation of $p(200)$ the contributions from arcs of the circle near roots of unity of order 1, 2, 3, 4 and 5 have 13, 5, 2, 1 and 1 digits, respectively, but in the corresponding calculation for $p_2(100000)$ these contributions have 60, 27, 4, 33, and 16 digits, respectively, of wildly varying sizes