errors with spyder in anaconda after installing mne python

External Email - Use Caution

Dear all,

I'm not sure if this is relevant for this mailing list but I'm having a weird error with anaconda/mne installation.

I had an older version of anaconda running python 2.7 (from analysis a while ago) and decided to update anaconda and mne, by uninstalling and reinstalling both (updating it wasn't working). Anyway, once I've got the latest release versions of the two I opened anaconda and then tried to open spyder (I like to use it), and I get this error:

Traceback (most recent call last):
File "C:\Users\fairs\Anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 22, in
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\fairs\Anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\fairs\Anaconda3\lib\site-packages\spyder\app\start.py", line 201, in main
from spyder.app import mainwindow
File "C:\Users\fairs\Anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 83, in
from qtpy import QtWebEngineWidgets # analysis:ignore
File "C:\Users\fairs\Anaconda3\lib\site-packages\qtpy\QtWebEngineWidgets.py", line 26, in
from PyQt5.QtWebKitWidgets import QWebPage as QWebEnginePage
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'

I then updated conda, but still got the error, so I decided to uninstall and reinstall anaconda. When I did this, spyder would then launch. But then when I install mne python, and go back to open spyder, I get the same message.

I assume the packages installed when installing mne python (from the environment.yml file) somehow break something that anaconda needs, or create an incompatability? But I have to be honest I have absolutely no clue.

Has anyone else run into this problem or is there a solution? I'd like to keep using spyder as my IDE from within anaconda so a fix to this would be excellent.

Best,

Amie

External Email - Use Caution

hi,

can you report what

mne.sys_info()

reports in a simple python terminal?

did you remove all other Python / anaconda installs from your machine?

Alex

External Email - Use Caution

Hi Amie,

One option you could try is what Spyder developers call "the modular installation approach" [1] --- install Spyder into one conda environment, and install MNE-Python into a different environment. Then, when you launch Spyder, change the "Preferences > Python Interpreter > Use the following interpreter" setting to match the python executable in the MNE-Python conda environment. This would look something like:

# download MNE-Python environment file
curl --remote-name https://raw.githubusercontent.com/mne-tools/mne-python/master/environment.yml
# create new environment "mne"
conda env update -n mne --file environment.yml
# create new environment "spyder"
conda create -n spyder python=3 spyder
# activate spyder env & launch Spyder GUI
conda activate spyder
spyder
# now, set the python interpreter as described.

[1]: https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#working-with-other-environments-and-python-installations

-- dan
Daniel McCloy
https://dan.mccloy.info
Research Scientist
Institute for Learning and Brain Sciences
University of Washington

??? Original Message ???