Edward Lomas, 62, from Romford, was found dead in his cell at HMP Pentonville in May last year, a Prisons and Probation Ombudsman (PPO) report revealed.
Four months earlier he was jailed for 12 years and six months for sexual offences committed against children.
Prior to his death Lomas told a prison chaplain he sometimes wished he could go to sleep and not wake up.
MORE NEWS: Arrest made as man critically injured after being stabbed in Rainham assault
Lomas then took an overdose and was found unresponsive in his cell in the early hours of May 22.
In February, a coroner recorded a verdict of suicide.
A PPO report said that the head of drug strategy and the lead pharmacist at the prison should develop officer training to monitor medication after Lomas was able to “hoard” and illegally obtain prescription drugs.