The Ruderman-Kittel-Kasuya-Yoshida interaction between, magnetic impurities in single-walled nanotubes is studied in the framework of a free electron model. It is found that the interaction decays inversely as axial separation between the impurities as in the case of a purely one-dimensional system. The key feature found is that the inverse-distance interaction is modulated by a nonperiodic function that depends on the size (radius) of the tube. Implications for magnetically doped nanotubes are discussed.