error with interpolate_bads

Dear list,
I am running into errors when trying to interpolate bad channels.
I have tried it on different versions of my M/EEG data, but the problem is
there from the raw import (data recorded at Neurospin). Running
interpolate_bads on freshly imported data (no maxfilter applied) gives the
errors below. Same after applying Maxfilter (and adding a bad MEG channel).

Any help would be greatly appreciated.
Best, Sophie

*Picking either meg, mag or grad:*
File
"/home/sh252228/.local/lib/python2.7/site-packages/numpy/core/einsumfunc.py",
line 710, in einsum_path
"not match previous terms.", char, tnum)

ValueError: ("Size of label '%s' for operand %d does not match previous
terms.", 'i', 1)

*Picking EEG:*
File
"/home/sh252228/.local/lib/python2.7/site-packages/scipy/optimize/cobyla.py",
line 252, in _minimize_cobyla
rhoend=rhoend, iprint=iprint, maxfun=maxfun,

UnboundLocalError: local variable 'iprint' referenced before assignment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180220/c49565d5/attachment-0001.html

Hi Sophie,

If I had to guess, I would say you have an installation problem. Can you
make sure you reproduce this problem on other systems?

Mainak

Hi Mainak,
Indeed. It doesn't reproduce on another system.
Thank you for pointing that out!
Sophie

Hi Mainak,
sorry to bug you again, but it still doesn't work.

I uninstalled and reinstalled anaconda following the descriptions on the
mne website.
When installing the dependencies, I run into this
<https://github.com/conda/conda/issues/5985> issue and followed the work
around of creating an environment for mayavi.
I get no error messages during installation, but still the same errors with
interpolate_bads.
Any idea what I could do?

Thank you!
Sophie

Hi Sophie,

I suspect you have conflicting python packages in your
/home/sh252228/.local/ directory which are installed when you use the flag
--user with pip. There is a priority order for the packages to be imported
and it's possible you are importing some library which is not from Anaconda
or an older version.

Make sure you have removed everything that is in site.getusersitepackages()
and site.getsitepackages(). Only after that, make a fresh install of
Anaconda.

I would recommend asking your sysadmin for help if you're still stuck.

Best,
Mainak

Hi Mainak,
after uninstalling all the packages and reinstalling anaconda, the errors
persisted, but now the error messages contained the right path to my
anaconda installation.
I finally found out that there were two apparently independent issues, one
with scipy's cobyla function and one with numpy's einsum function:
https://github.com/scipy/scipy/issues/8118
https://github.com/numpy/numpy/issues/10343
I managed to fix it by manually editing cobyla and uninstalling and
reinstalling numpy (not sure why the updated version wasn't installed right
away).
Not sure whether my solution is the cleanest one, but I thought it might be
usefull to know these issues in case someone else runs into similar
problems.
Best,
Sophie

I finally found out that there were two apparently independent issues, one
with scipy's cobyla function and one with numpy's einsum function:
minimize_cobyla broken if `disp=True` passed · Issue #8118 · scipy/scipy · GitHub
https://github.com/numpy/numpy/issues/10343
I managed to fix it by manually editing cobyla and uninstalling and
reinstalling numpy (not sure why the updated version wasn't installed right
away).
Not sure whether my solution is the cleanest one, but I thought it might
be usefull to know these issues in case someone else runs into similar
problems.

Thanks for tracking those down -- indeed, they should be fixed by
forthcoming maintenance releases of SciPy (1.0.1) and NumPy (1.14.1).

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180222/86400016/attachment-0001.html