Hello, I donât know why, but when I try to import mayavi or pyvisa it gives me the following error:
import mayavi
Changing backend to Qt for Mayavi
Traceback (most recent call last):
File "<ipython-input-51-391e74ae0ec1>", line 1, in <module>
import mayavi
ModuleNotFoundError: No module named 'mayavi'
import pyvista
Traceback (most recent call last):
File "<ipython-input-52-3c968869802d>", line 1, in <module>
import pyvista
ModuleNotFoundError: No module named 'pyvista'
But when I try python -c "import mne;
mne.sys_info()" in the Anaconda Powershell Prompt they are found:
Platform: Windows-10-10.0.19042-SP0
Python: 3.9.7 | packaged by conda-forge | (default, Sep 2 2021, 17:55:20) [MSC v.1916 64 bit (AMD64)]
Executable: C:\Users\angel\anaconda3\envs\mne\python.exe
CPU: Intel64 Family 6 Model 165 Stepping 2, GenuineIntel: 12 cores
Memory: 15.9 GB
mne: 0.23.3
numpy: 1.21.2 {blas=NO_ATLAS_INFO, lapack=lapack}
scipy: 1.7.1
matplotlib: 3.4.3 {backend=Qt5Agg}
sklearn: 0.24.2
numba: Not found
nibabel: 3.2.1
nilearn: 0.6.2
dipy: 1.3.0
cupy: Not found
pandas: 1.3.2
mayavi: 4.7.2
pyvista: 0.31.3 {pyvistaqt=0.5.0, OpenGL 4.5.0 - Build 27.20.100.8729 via Intel(R) UHD Graphics}
vtk: 9.0.1
PyQt5: 5.12.3
Could anyone help me to find why it is not working? (I am working in the mne enviroment, not in the base enviroment)
escribe o pega el cĂłdigo aquĂ
import mne
mne.sys_info()
Platform: Windows-10-10.0.19041-SP0
Python: 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]
Executable: C:\Users\angel\anaconda3\python.exe
CPU: Intel64 Family 6 Model 165 Stepping 2, GenuineIntel: 12 cores
Memory: 15.9 GB
mne: 0.23.0
numpy: 1.20.1 {blas=mkl_rt, lapack=mkl_rt}
scipy: 1.6.2
matplotlib: 3.3.4 {backend=Qt5Agg}
sklearn: 0.24.1
numba: 0.53.1
nibabel: Not found
nilearn: Not found
dipy: Not found
cupy: Not found
pandas: 1.2.4
mayavi: Not found
pyvista: Not found
vtk: Not found
Why are these modules not loaded in the Python prompt? What is the solution to this problem?
Thanks for all the help again and sorry for the inconvinience (Iâm a beginner using MNE).
it appears youâre not running Python from your MNE environment. Either open the âmneâ Anaconda Prompt (I think this is what itâs called on Windows?), or type
conda activate mne
(where mne is the name of the environment you created)
Hello, I am writing my code in spyder, but using my spyder console I cannot manage to access to MNE. How could I access to MNE using the spyder console? I can only access to MNE using the anaconda prompt, but this prompt is not connected to spyder.
Hello, I have already done those steps, but when I open spyder again using the mne enviroment the following error ocures:
An error ocurred while starting the kernel
Your Python environment or installation doesn't have the spyderâkernels module or the right version of it installed (>= 1.10.0 and < 1.11.0). Without this module is not possible for Spyder to create a console for you.
You can install it by running in a system terminal:
conda install spyderâkernels
or
pip install spyderâkernels```
When I do that:
Spyder is decomposed in 2 modules: spyder and spyder-kernels. The kernel is needed for the IPython console. In the MNE environment, install spyder-kernels and it will work.
yes, that is expected. The error message you pasted above states
Your Python environment or installation doesnât have the spyderâkernels module or the right version of it installed (>= 1.10.0 and < 1.11.0)
So downgrading from spyder-kernels 2.0.5 to spyder-kernels 1.10.2 is the right solution.
For future readers: Spyder is usually installed into âbaseâ environment, so if you want to use the âmneâ environment in spyderâs built-in console, you need spyder-kernels installed in the âmneâ environment, and its version must match one of the versions that your installed version of spyder is expecting. In other words, spyderâs advice to use conda install spyder-kernels or pip install spyder-kernels is incomplete: you usually also need to specify a particular version, like conda install spyder-kernels==1.10.