0

I have already installed mne packages but nothing detected by jupyter notebook

I got this error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [4], line 12
     10 from time import sleep
     11 import pyeeg
---> 12 import mne
     14 import warnings
     15 warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) 

File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\mne\__init__.py:31    

ValueError: source code string cannot contain null bytes

init.py:31 look like

from .io.base import concatenate_raws

The package was installed with

pip install mne --user
YEUNG_SANG
  • 61
  • 1
  • 6
  • If you were getting what your title says, I'd suggest ...Try `%pip install mne` in a cell in the notebook above the cell your are trying `import nme`. After the install cell completes, restart the kernel and try the import again. ... However, what you posted in your traceback isn't the result of a missing module. Some weird character seems to have creeped into `mne\__init__.py` on line 31, it seems? See [here](https://stackoverflow.com/questions/31233777/python-source-code-string-cannot-contain-null-bytes#comment50467741_31233777). Maybe clear the how `nme` package and reinstall it? See ... – Wayne Nov 21 '22 at 22:02
  • 1
    advice on how to uninstal pip installed items and first try the appropriate variation on `pip uninstall mne`. And if that doesn't clear it all out, see where it says you can get rid of directories in `site-packages` [here](https://stackoverflow.com/a/64939049/8508004). Then try re-installing. If you'll only use it from Jupyter notebooks, you can try `%pip install mne` after all that. Make sure you shut down Jupyter before you started trying to get rid of the offending installation. – Wayne Nov 21 '22 at 22:07
  • What in particular worked? – Wayne Nov 23 '22 at 16:04
  • 1
    After unistalling via pip and I got information to go and manually remove the old mne files and folders, then I reinstalled via pip with this command and now it works `pip install mne --user` @Wayne – YEUNG_SANG Nov 25 '22 at 05:20

0 Answers0