ValueError: All picks must be < n_channels (73), got 73

@drammock, sorry for the late reply. Sometimes I don’t get reply notifications. And sorry for the long reply.

mne.sys_info() yields the following.


Platform             Windows-10-10.0.19045-SP0
Python               3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Executable           c:\users\raahul pathak\appdata\local\programs\python\python39\python.exe
CPU                  AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD (24 cores)
Memory               15.9 GB

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-9aec79aab825> in <module>
      1 # p01_raw = mne.io.read_raw_bdf(p01)
----> 2 mne.sys_info()

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\mne\utils\config.py in sys_info(fid, show_paths, dependencies, unicode)
    628     out("\n")
    629     ljust -= 3  # account for +/- symbols
--> 630     libs = _get_numpy_libs()
    631     unavailable = []
    632     use_mod_names = (

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\mne\utils\config.py in _get_numpy_libs()
    544     except Exception as exc:
    545         return bad_lib + f" (threadpoolctl module not found: {exc})"
--> 546     pools = threadpool_info()
    547     rename = dict(
    548         openblas="OpenBLAS",

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in threadpool_info()
    122     In addition, each module may contain internal_api specific entries.
    123     """
--> 124     return _ThreadpoolInfo(user_api=_ALL_USER_APIS).todicts()
    125 
    126 

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in __init__(self, user_api, prefixes, modules)
    338 
    339             self.modules = []
--> 340             self._load_modules()
    341             self._warn_if_incompatible_openmp()
    342         else:

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in _load_modules(self)
    371             self._find_modules_with_dyld()
    372         elif sys.platform == "win32":
--> 373             self._find_modules_with_enum_process_module_ex()
    374         else:
    375             self._find_modules_with_dl_iterate_phdr()

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in _find_modules_with_enum_process_module_ex(self)
    483 
    484                 # Store the module if it is supported and selected
--> 485                 self._make_module_from_path(filepath)
    486         finally:
    487             kernel_32.CloseHandle(h_process)

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in _make_module_from_path(self, filepath)
    513             if prefix in self.prefixes or user_api in self.user_api:
    514                 module_class = globals()[module_class]
--> 515                 module = module_class(filepath, prefix, user_api, internal_api)
    516                 self.modules.append(module)
    517 

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in __init__(self, filepath, prefix, user_api, internal_api)
    604         self.internal_api = internal_api
    605         self._dynlib = ctypes.CDLL(filepath, mode=_RTLD_NOLOAD)
--> 606         self.version = self.get_version()
    607         self.num_threads = self.get_num_threads()
    608         self._get_extra_info()

c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages\threadpoolctl.py in get_version(self)
    644                              lambda: None)
    645         get_config.restype = ctypes.c_char_p
--> 646         config = get_config().split()
    647         if config[0] == b"OpenBLAS":
    648             return config[1].decode("utf-8")

AttributeError: 'NoneType' object has no attribute 'split'

However, if I run !pip list on Jupyter it yields package names and versions.

!pip list
Package                 Version
----------------------- -------------------
absl-py                 0.12.0
anyio                   3.2.0
appdirs                 1.4.4
argon2-cffi             20.1.0
astunparse              1.6.3
async-generator         1.10
attrs                   21.2.0
backcall                0.2.0
beautifulsoup4          4.11.1
bleach                  3.3.0
blis                    0.7.8
bokeh                   3.1.1
cachetools              4.2.2
catalogue               2.0.8
certifi                 2021.5.30
cffi                    1.14.5
chardet                 4.0.0
click                   8.1.3
cloudpickle             2.2.1
colorama                0.4.4
contourpy               1.0.7
cycler                  0.10.0
cymem                   2.0.6
Cython                  0.29.28
dataPreprocess          0.2.7
daytime                 0.4
decorator               5.0.9
WARNING: Ignoring invalid distribution -illow (c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -illow (c:\users\raahul pathak\appdata\local\programs\python\python39\lib\site-packages)

[notice] A new release of pip is available: 23.0.1 -> 23.2.1
[notice] To update, run: c:\Users\Raahul Pathak\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip

defusedxml              0.7.1
entrypoints             0.3
flatbuffers             1.12
fsspec                  2023.5.0
gast                    0.4.0
gensim                  4.2.0
gitdb                   4.0.7
GitPython               3.1.18
google-auth             1.30.1
google-auth-oauthlib    0.4.4
google-pasta            0.2.0
graphviz                0.16
grpcio                  1.34.1
h5py                    3.1.0
hdbscan                 0.8.29
idna                    2.10
importlib-metadata      6.6.0
inflect                 6.0.0
ipykernel               5.5.5
ipython                 7.23.1
ipython-genutils        0.2.0
ipywidgets              7.6.3
jedi                    0.18.0
Jinja2                  3.0.1
joblib                  1.0.1
jsonschema              3.2.0
jupyter                 1.0.0
jupyter-client          6.1.12
jupyter-console         6.4.0
jupyter-core            4.7.1
jupyter-server          1.8.0
jupyter-server-mathjax  0.2.3
jupyterlab-git          0.30.1
jupyterlab-pygments     0.1.2
jupyterlab-widgets      1.0.0
Keras                   2.4.3
keras-nightly           2.5.0.dev2021032900
Keras-Preprocessing     1.1.2
kiwisolver              1.3.1
langcodes               3.3.0
lazy_loader             0.2
linkify-it-py           2.0.2
llvmlite                0.40.0
locket                  1.0.0
logging                 0.4.9.6
Markdown                3.3.4
MarkupSafe              2.0.1
mat                     1.0.2
matplotlib              3.4.2
matplotlib-inline       0.1.2
mdurl                   0.1.2
mistune                 0.8.4
mne                     1.5.0
mneflow                 0.4.0
multipledispatch        0.6.0
murmurhash              1.0.8
mysql-connector-python  8.0.32
nbclient                0.5.3
nbconvert               6.0.7
nbdime                  3.1.0
nbformat                5.1.3
nest-asyncio            1.5.1
networkx                3.1
nltk                    3.7
notebook                6.4.0
numba                   0.57.0
numpy                   1.22.4
oauthlib                3.1.1
opt-einsum              3.3.0
packaging               23.1
pandas                  2.0.1
pandocfilters           1.4.3
param                   1.13.0
parso                   0.8.2
partd                   1.4.0
pathy                   0.6.2
pexpect                 4.8.0
pickleshare             0.7.5
Pillow                  9.5.0
pip                     23.0.1
plotly                  5.10.0
pooch                   1.6.0
preshed                 3.0.7
prometheus-client       0.10.1
prompt-toolkit          3.0.18
protobuf                3.17.2
psutil                  5.9.5
ptyprocess              0.7.0
pyasn1                  0.4.8
pyasn1-modules          0.2.8
pycosat                 0.6.3
pycparser               2.20
pyct                    0.5.0
pydantic                1.9.2
pydot                   1.4.2
Pygments                2.9.0
pynndescent             0.5.10
pyparsing               2.4.7
PyQt6                   6.3.1
PyQt6-Qt6               6.3.1
PyQt6-sip               13.4.0
pyriemann               0.4
pyrsistent              0.17.3
pyspellchecker          0.6.3
python-dateutil         2.8.2
pytz                    2021.1
pyviz-comms             2.3.0
PyWavelets              1.4.1
pywin32                 300
pywinpty                1.1.1
PyYAML                  5.4.1
pyzmq                   22.1.0
qtconsole               5.1.0
QtPy                    1.9.0
regex                   2022.8.17
requests                2.25.1
requests-oauthlib       1.3.0
rsa                     4.7.2
scikit-learn            0.24.2
scipy                   1.9.1
seaborn                 0.11.1
Send2Trash              1.5.0
sequence                0.3.4
setuptools              63.2.0
six                     1.15.0
sklearn                 0.0
smart-open              5.2.1
smmap                   4.0.0
sniffio                 1.2.0
soupsieve               2.3.2.post1
spacy                   3.4.1
spacy-legacy            3.0.10
spacy-loggers           1.0.3
srsly                   2.4.4
tabulate                0.9.0
tenacity                8.0.1
tensorboard             2.5.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit  1.8.0
tensorflow              2.5.0
tensorflow-estimator    2.5.0
termcolor               1.1.0
terminado               0.10.0
testpath                0.5.0
thinc                   8.1.0
threadpoolctl           2.1.0
tifffile                2023.4.12
toolz                   0.12.0
torch                   1.12.0
tornado                 6.1
tqdm                    4.64.0
trainer                 0.0.1
traitlets               5.0.5
typer                   0.4.2
typing-extensions       3.7.4.3
tzdata                  2023.3
uc-micro-py             1.0.2
umap-learn              0.5.3
Unidecode               1.3.4
urllib3                 1.26.5
utils                   1.0.1
wasabi                  0.10.1
wcwidth                 0.2.5
webencodings            0.5.1
websocket-client        1.1.0
Werkzeug                2.0.1
wheel                   0.37.1
widgetsnbextension      3.5.1
word2number             1.1
wrapt                   1.12.1
xyzservices             2023.5.0
zipp                    3.15

Oh. I got the notification, but must’ve dismissed it by accident.

if mne.sys_info() is failing then something is deeply wrong with the install environment. Can you try either using our standalone installer, or reinstalling in a new virtual environment? If I’m reading correctly I think you’re running this in a Jupyter Notebook, so after the reinstall make sure you select the right kernel for your notebook (the one associated with the new MNE-containing environment).

1 Like

Can you please re-send the github link? It says the page was not found.

Your hyperlink redirects to this link. https://mne.tools/dev/install/manual_install.htm

oops, the final L in “HTML” got lost in the copy-paste. I’ve edited the previous post to fix the link

@drammock, is there a way I can virtually talk to you? I know that is a hard/weird/big ask, but I am struggling to all hell with everything and I feel that this can be resolved much more quickly and easily if we do this live.

Hi @RPathak there are bi-weekly live office hours, every other Friday at 15:00 UTC, that the MNE devs attend to help users with specific questions. The last office hour was yesterday actually, so the next one should be Friday September 1st at 15:00 UTC.

Sorry if that’s a long wait, but it may be the best opportunity for you to get some live help!

Is there a way I can schedule a special office hour for earlier with someone? I really need this as a fast as I can because this is my thesis project for my master’s degree.

This is not a jab at you or anyone in particular so please don’t take it harshly, but I, nor anyone new to the MNE forum would think that you have live office hours. And, if you did tell new people at the beginning or at any time, it was not told/reminded to them as often as it should be to remind them about the office hours.

This is just feedback but you need to tell it to everyone at the beginning of the posts and more often so if they need it, they can go to it. I was free and just waiting for responses/struggling to get things to work yesterday. I would’ve done everything I could to make the live office hours had I known they existed and had I known what time they were. But, I didn’t think that MNE had live hours because not many forums at all have live support.

Sorry for the rant, but this is very annoying at how it was not communicated well to me about the live support.

We have not been good at announcing them recently. Looks like the most recent announcement was in June (2 months ago): Next online office hour today, June 9

So contrary to your strongly worded assumption about what “anyone new to the forum” would know, in fact most people new to the forum hear about the office hours within a couple weeks. I’m sorry if you joined in the last 2 months and didn’t hear about them right away.

I won’t take the time to explain exactly why announcements have slipped lately or why I don’t have time to arrange a special meeting just for you, but please think about the fact that almost everyone else here is also in academia and also has deadlines of their own to manage, and almost all are answering forum questions as a volunteer activity (exactly 2 people support MNE as part of their job and neither of them do it full-time).

If you want further help, please try one or more of these things:

  1. use a standalone installer for version 1.5.0 (just released a couple days ago, and there’s a report that it might be buggy on macOS, not sure about windows)
  2. use a standalone installer for version 1.4.2 (widely tested on all platforms)
  3. follow the manual install instructions I linked previously, for creating a new virtual environment yourself and running MNE in that virtual environment.

If they all fail, report back what went wrong and we’ll continue trying to help solve it. I would also recommend to test out in a plain IPython interpreter rather than a Jupyter notebook — at least at first. Jupyter notebooks adds an extra layer where things might get configured wrong, so it’s better to work up to it (make sure plain terminal IPython works first) rather than starting with notebooks.

Okay. Let me try to install the standalone one more time. I will uninstall everything MNE-based, and try to do it from scratch one more time. I thought I did that last time, but I’ll try one more time.
I will keep you updated on it. I tried to do it with MNE 1.5.0 earlier when you helped me. Let me try one more time with 1.5.0.

And, I’m sorry for the strongly worded message. When I typed that, it was a mixture of emotions and also annoyance at how the live support were yesterday.
I never thought a forum would have live support, so there was a lot of emotions going on.
Thank you for dealing with the strongly worded message I put up.

I will keep you updated on everything.

1 Like

Would a space in the user directory make any of the MNE conda packages not work properly? When I am installing MNE, it says a space in my directory path may cause some conda packages to not work. It hasn’t been a problem until now, but I am unsure if MNE falls under that list of “not working” conda packages.

What I mean is, part of my directory path is
C:\Users\Raahul Pathak.…

Okay, so, we have good news and we have bad news.

The good news is, after installing MNE via admin due to the whole space thing with my path, I ran sys_info() on Spyder(MNE) and it did not give me an attribute error. I know at the very beginning you wanted the stuff from sys_info() to help troubleshoot the initial problem, so here is the output to sys_info()

runfile('C:/Users/Raahul Pathak/.spyder-py3/temp.py', wdir='C:/Users/Raahul Pathak/.spyder-py3')
Platform             Windows-10-10.0.19045-SP0
Python               3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 17:59:51) [MSC v.1935 64 bit (AMD64)]
Executable           C:\ProgramData\mne-python\1.5.0_0\python.exe
CPU                  AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD (24 cores)
Memory               15.9 GB

Core
├☑ mne               1.5.0
├☑ numpy             1.24.4 (MKL 2022.1-Product with 12 threads)
├☑ scipy             1.11.1
├☑ matplotlib        3.7.2 (backend=module://ipympl.backend_nbagg)
├☑ pooch             1.7.0
└☑ jinja2            3.1.2

Numerical (optional)
├☑ sklearn           1.3.0
├☑ numba             0.57.1
├☑ nibabel           5.1.0
├☑ nilearn           0.10.1
├☑ dipy              1.7.0
├☑ openmeeg          2.5.6
├☑ pandas            2.0.3
└☐ unavailable       cupy

Visualization (optional)
├☑ pyvista           0.41.1C:\ProgramData\mne-python\1.5.0_0\Lib\site-packages\threadpoolctl.py:1010: RuntimeWarning: 
Found Intel OpenMP ('libiomp') and LLVM OpenMP ('libomp') loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see
    https://github.com/joblib/threadpoolctl/blob/master/multiple_openmp.md

  warnings.warn(msg, RuntimeWarning)
 (OpenGL 4.5.0 NVIDIA 536.23 via NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2)
├☑ pyvistaqt         0.0.0
├☑ ipyvtklink        0.2.2
├☑ vtk               9.2.6
├☑ qtpy              2.3.1 (PyQt5=5.15.8)
├☑ ipympl            0.9.3
├☑ pyqtgraph         0.13.3
└☑ mne-qt-browser    0.5.2

Ecosystem (optional)
├☑ mne-bids          0.12
├☑ mne-nirs          0.5.0
├☑ mne-features      0.2.1
├☑ mne-connectivity  0.5.0
├☑ mne-bids-pipeline 1.4.0
└☐ unavailable       mne-icalabel

The bad news is loading in the file and trying to create the raw.info structure is still stopping somewhere. I ran mne.io.read_raw_bdf() on the p01 file and let it run for twelve to thirteen minutes. And nothing happened. It was still creating it. Here is the output to the following lines:
Lines:

p01 = "C:/Users/Raahul Pathak/Research/Raahul/Thesis-Project/Participant-Information/p1.bdf"
p01_raw = mne.io.read_raw_bdf(p01)

Output

runfile('C:/Users/Raahul Pathak/.spyder-py3/temp.py', wdir='C:/Users/Raahul Pathak/.spyder-py3')
Extracting EDF parameters from C:\Users\Raahul Pathak\Research\Raahul\Thesis-Project\Participant-Information\p1.bdf...
BDF file detected
Setting channel info structure...
Creating raw.info structure...

All of this is being done on Spyder(MNE) and all is being done on a temporary file/directory because I just wanted to see if it would load in the data.

OK, so it’s good that you are now using Spyder instead of Jupyter, it’s simpler. And your install now “works”. Could you now share the file, e.g. on a OneDrive, GoogleDrive, whatever, so that we can try to load it on our side any determine if there is something wrong with the file, if there is something wrong with how we read the file, or if there is something hanging your python interpreter.

Mathieu

Also @drammock instead of announcements of the next office hours, how about a permanent banner saying: “Live office hours bi-weekly on Fridays 15h UTC on Discord (with link)” + a link to a google calendar/iCal subscription to the bi-weekly event?

3 Likes

This is one of the twelve bdf files I am trying to load in. This is the initial one that I tried which started this whole thing. I tried the second file I want to load in and the same error happened.

I can load and plot it fine.

from mne.io import read_raw

raw = read_raw("p1.bdf")
raw.load_data()
raw.plot()

Whatever is going on is sadly on your side only.

Mathieu

Please double-check a few things:

  1. in spyder, go to tools > preferences and select the Python interpreter section. There are two choices, “default (same as spyder)” and “use the following python interpreter”. Select the second one and paste the Python executable from your mne.sys_info() output in there (C:\ProgramData\mne-python\1.5.0_0\python.exe). Save the setting, then close and restart Spyder.

  2. in the integrated ipython console type import sys; print(sys.executable) and tell us what it says

  3. try pasting this directly into the integrated terminal rather than using the “runfile” command:

import mne
fname = "C:\Users\Raahul Pathak\Research\Raahul\Thesis-Project\Participant-Information\p1.bdf"
raw = mne.io.read_raw_bdf(fname)

You need to use / instead of \ in the fname string, or a raw string.