I took newer source code of this function from the project and all is going well.

So to get the RMS power from PSD :

y, x = pylab.psd(data, NFFT = nfft, Fs = samplerate)

freqbandwith = x[1]

y = y*freqbandwith

rms = scipy.sqrt(y.sum())

It should be the same as :

rms = data**2

rms = scipy.sqrt(rms.sum()/len(data))