SpikeSortingLoader has no raw_electrophysiology attribute error

I can’t use the streaming of lfp tutorial. I have updates both ibllib and brainbox. I am trying to stream the lfp around a certain event but I get an error stating that SpikeSortingLoader has no raw_electrophysiology attribute.

ibllib is version 2.35.2, brainbox is version 0.0.7 in my environment. I just upgraded them and it did not fix the error.

Code:

from one.api import ONE

from brainbox.io.one import SpikeSortingLoader

import matplotlib.pyplot as plt

import scipy.signal

from brainbox.ephys_plots import plot_brain_regions

from ibllib.plots import Density
ssl = SpikeSortingLoader(pid=probe_id, one=one)

# The channels information is contained in a dict table / dataframe

channels = ssl.load_channels()

# Get AP and LFP spikeglx.Reader objects

sr_lf = ssl.raw_electrophysiology(band="lf", stream=True)

Error:
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[48], [line 6](vscode-notebook-cell:?execution_count=48&line=6) [3](vscode-notebook-cell:?execution_count=48&line=3) channels = ssl.load_channels() [5](vscode-notebook-cell:?execution_count=48&line=5) # Get AP and LFP spikeglx.Reader objects ----> [6](vscode-notebook-cell:?execution_count=48&line=6) sr_lf = ssl.raw_electrophysiology(band="lf", stream=True) AttributeError: 'SpikeSortingLoader' object has no attribute 'raw_electrophysiology'

Note I am planning on plotting using this code later, I do not need the ap.

Plotting to do:

sos_lf = scipy.signal.butter(3,   2 / sr_lf.fs /2, btype='highpass', output='sos')  #   2 Hz high pass LF band
filtered_lf = scipy.signal.sosfiltfilt(sos_lf, raw_lf)

# displays the AP band and LFP band around this stim_on event
fig, ax = plt.subplots(figsize=(9, 6))
Density(- filtered_lf, fs=sr_lf.fs, taxis=1, ax=ax)
plot_brain_regions(channels["atlas_id"], channel_depths=channels["axial_um"], ax=ax, display=True)

Hello,

To investigate further, could you please run the following in a Python shell with your environment ?

from pathlib import Path
import ibllib
print(ibllib.__version__)
print(ibllib.__file__)

import brainbox
print(brainbox.__file__)


assert Path(*Path(brainbox.__file__).parts[:-2]) == Path(*Path(ibllib.__file__).parts[:-2]),\
    'oops it seems brainbox and ibllib are not in the same package'

And the following in a terminal:
pip list | grep brainbox
pip list | grep ibllib

I wonder if there could be this brainbox package that is still free floating in your environment.

If you are not using it then just unistall it pip uninstall brainbox.

Gave me the following output…

2.35.2
/home/acampbell/miniconda3/envs/ONE_ibl_env/lib/python3.10/site-packages/ibllib/__init__.py
/home/acampbell/miniconda3/envs/ONE_ibl_env/lib/python3.10/site-packages/brainbox/__init__.py

Yes that could be the issue if that old brainbox is still in there, or if some paths are still going to it.