No, not necessarily. Root canal treatment is carried out under local anaesthetic. Once the tooth has been numbed up sufficiently, the procedure is painless.
There can be exceptions if the tooth is very severely infected and cannot be numbed up adequately. In these cases, the dentist might prescribe medication first to reduce the severity of the infection and pain before the tooth is treated.