Working with sEEG data: error with mne.viz.Brain

Hi! Thank you for your help; I am new here :slight_smile:

  • MNE version: e.g. 1.5.1 (last)
  • operating system: macOS Sonoma 14.0

Following the working with sEEG data example (Working with sEEG data — MNE 1.5.1 documentation), when I try to visualize the brain->

brain = mne.viz.Brain(
    "fsaverage",
    subjects_dir=subjects_dir,
    cortex="low_contrast",
    alpha=0.25,
    background="white",
)

I get an error of

AttributeError: module ‘numpy’ has no attribute ‘bool’.
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
The aliases was originally deprecated in NumPy 1.20;

I am using the wrong version of MNE or something else? I followed MNE installation as denoted in the website with conda (Install via pip or conda — MNE 1.5.1 documentation)

Thank you!

Hello and welcome to the forum! Could you please paste the entire traceback (the many lines of error messages)? This will help us see where the error occurred exactly. I don’t think you’re doing anything wrong, it’s something that needs fixing on our side.

Best wishes,
Richard

Thank you for your welcome message and help, Richard :slight_smile:
Below is the full error

      5 # note that this is the same as:
      6 # ``mne.transforms.invert_transform(
      7 #      mne.transforms.combine_transforms(head_mri_t, mri_mni_t))``
      9 view_kwargs = dict(azimuth=105, elevation=100, focalpoint=(0, 0, -15))
---> 10 brain = mne.viz.Brain(
     11     "fsaverage",
     12     subjects_dir=subjects_dir,
     13     cortex="low_contrast",
     14     alpha=0.25,
     15     background="white",
     16 )
     17 brain.add_sensors(epochs.info, trans=trans)
     18 brain.add_head(alpha=0.25, color="tan")

File ~/anaconda3/envs/mne/lib/python3.11/site-packages/mne/viz/_brain/_brain.py:435, in Brain.__init__(***failed resolving arguments***)
    428 if self._layered_meshes.get(h) is None:
    429     mesh = _LayeredMesh(
    430         renderer=self._renderer,
    431         vertices=self.geo[h].coords,
    432         triangles=self.geo[h].faces,
    433         normals=self.geo[h].nn,
    434     )
--> 435     mesh.map()  # send to GPU
...

**AttributeError**: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations```

Any updates on my error @richard , please?

Thank you