autoreject: Missing import for IPython console execution.
While trying out the new workflow tutorial, I ran into a couple of issues with the progress bars.
In a new environment, in the python console, nothing breaks, and the progress bar work. With the same environment, in the Spyder IPython console, I get:
Running autoreject on ch_type=eeg
Traceback (most recent call last):
File "/Users/scheltie/Downloads/autoreject.py", line 81, in <module>
ar.fit(epochs[:20]) # fit on a few epochs to save time
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/autoreject-0.3.dev0-py3.8.egg/autoreject/autoreject.py", line 1007, in fit
_run_local_reject_cv(epochs, thresh_func, this_picks,
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/autoreject-0.3.dev0-py3.8.egg/autoreject/autoreject.py", line 766, in _run_local_reject_cv
local_reject.fit(epochs)
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/autoreject-0.3.dev0-py3.8.egg/autoreject/autoreject.py", line 680, in fit
self.threshes_ = self.thresh_func(
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/autoreject-0.3.dev0-py3.8.egg/autoreject/autoreject.py", line 435, in _compute_thresholds
epochs_interp = _clean_by_interp(epochs, picks=picks,
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/autoreject-0.3.dev0-py3.8.egg/autoreject/utils.py", line 228, in _clean_by_interp
for ch_idx, (pick, ch) in enumerate(_pbar(list(zip(picks, ch_names)),
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/autoreject-0.3.dev0-py3.8.egg/autoreject/utils.py", line 179, in _pbar
pbar = ProgressBar(iterable, mesg=desc, **kwargs)
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/mne-0.23.4-py3.8.egg/mne/utils/progressbar.py", line 80, in __init__
self._tqdm = tqdm(
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/tqdm/notebook.py", line 242, in __init__
self.container = self.status_printer(self.fp, total, self.desc, self.ncols)
File "/Users/scheltie/Documents/pyvenv/test/lib/python3.8/site-packages/tqdm/notebook.py", line 115, in status_printer
raise ImportError(
ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
Missing ipywidgets dependency? If I install it with pip, I then get another error message spam in the console: ERROR:traitlets:No such comm target registered: jupyter.widget.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 28 (18 by maintainers)
Ah, I didn’t realize I had fallen behind the latest version. I was on 0.24.1 and I see 1.0 is now out.
I just upgraded with
pip install -U mneto 1.0 and got a different error about mne/externals, which I was struggling to find in my site-packages. Then I created an entirely new conda env, which worked fine. Thanks for asking 😃Slick new visualizations with mne-1.0!
Oh, interesting. So autoreject is in fact running into the same issue! Thanks for the clarification!
@hoechenberger I guess a similar problem is occurring with
openneuro-py, but it’s not the one at cause here. In this issue, the error is caused by the progress bar displayed byAutoReject.fit(), no?That said, with openneuro version
2021.8, I do get an error, but maybe not the one you are expecting:The same code snippet works in the terminal, so the error is restricted to the IPython console. I’ll check the PR code and reply on the PR.