getting error while trying to import psd_welch

Hi , I run this line
from mne.time_frequency import psd_welch

And am getting this Error. few days before it was working normally but now it gives this error:

ImportError Traceback (most recent call last)
in
----> 1 from mne.time_frequency import psd_welch

ImportError: cannot import name ‘psd_welch’ from ‘mne.time_frequency’ (/usr/local/lib/python3.8/dist-packages/mne/time_frequency/init.py)


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
“Open Examples” button below.

1 Like

Hello,

This function has been deprecated in version 1.2 and removed in version 1.3, recently released.
Please use inst.compute_psd() instead:

raw = ...
spectrum = raw.compute_psd(method="welch")
data, freqs = spectrum.get_data(return_freqs=True)

Mathieu

1 Like