# How to solve "can not import name 'Brain' from 'Surfer'

**URL:** <https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390>\
**Category:** Support & Discussions\
**Created:** [February 9, 2022, 2:20pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390 "2022-02-09T14:20:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 9, 2022, 2:20pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/1 "2022-02-09T14:20:25Z")

</div>

![微信图片_20220209221810](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/a/a0684a387c125ac7150e2992ce5dca430ae2925d.png)  
Somehow I can not run python programme from MNE successfully due to this error, I have already installed pysurfer.  
running on linux, python 3.7 installed on linux.

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 9, 2022, 2:59pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/2 "2022-02-09T14:59:43Z")

</div>

What installation steps did you follow? Currently, we recommend installing mne to a separate conda environment. If you need to use 3d plotting, we have a separate section for that in the [installtion instructions](https://mne.tools/stable/install/mne_python.html#d-plotting-and-source-analysis).

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 4:34am UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/3 "2022-02-10T04:34:04Z")

</div>

Hello, it seems I have already installed all packages which needed, however when I tried to install mne-python, it came with:

(py37) [root@i]# conda create --name=mne --channel=conda-forge mne  
Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done  
Solving environment: /

then stucked ：(

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 6:16am UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/4 "2022-02-10T06:16:09Z")

</div>

when I run my python on linux, it comes with:  
File “/www/wwwroot/p.dongyangthu.com/codes/SplcV3.py”, line 10, in   
from surfer import Brain #用于可视化大脑皮层表面的三维网格上绘制数据  
ImportError: cannot import name ‘Brain’ from ‘surfer’ (/opt/miniconda3/envs/py37/lib/python3.7/site-packages/surfer/ **init**.py)

and packages I installed:  
^C(py37) [root@xxx]# conda create --name=mne channel=conda-forge mne  
Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done

when python -c “import mne; mne.sys\_info()”

ERROR:root:1:  
2022-02-10 14:14:33.162 ( 6.105s) [71FD41C0] vtkShaderProgram.cxx:453 ERR| vtkShaderProgram (0x558b1926c800): 0:31(22): error: syntax error, unexpected NEW\_IDENTIFIER, expecting ‘{’

ERROR:root:error: syntax error, unexpected NEW\_IDENTIFIER, expecting ‘{’  
2022-02-10 14:14:33.162 ( 6.105s) [71FD41C0]vtkOpenGLVertexArrayObj:265 ERR| vtkOpenGLVertexArrayObject (0x558b1931d680): attempt to add attribute without a program for attribute ndCoordIn  
ERROR:root:attempt to add attribute without a program for attribute ndCoordIn  
2022-02-10 14:14:33.163 ( 6.105s) [71FD41C0]vtkOpenGLQuadHelper.cxx:62 WARN| Error binding ndCoords to VAO.  
2022-02-10 14:14:33.163 ( 6.105s) [71FD41C0]vtkOpenGLRenderWindow.c:1102 ERR| vtkXOpenGLRenderWindow (0x558b186bed80): Couldn’t build the shader program for resolving msaa.  
ERROR:root:Couldn’t build the shader program for resolving msaa.  
Platform: Linux-5.10.60-9.al8.x86\_64-x86\_64-with-centos-3-Soaring\_Falcon  
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]  
Executable: /opt/miniconda3/envs/py37/bin/python  
CPU: x86\_64: 2 cores  
Memory: 3.6 GB

mne: 0.24.1  
numpy: 1.21.5 {blas=openblas, lapack=openblas}  
scipy: 1.7.3  
matplotlib: 2.2.2 {backend=TkAgg}

sklearn: 1.0.2  
numba: 0.55.1  
nibabel: 3.2.1  
nilearn: 0.9.0  
dipy: 1.4.1  
cupy: Not found  
pandas: 1.3.5  
mayavi: 4.7.4  
pyvista: 0.33.2 {OpenGL 3.1 Mesa 20.3.3 via llvmpipe (LLVM 11.0.0, 256 bits)}  
pyvistaqt: 0.7.0  
ipyvtklink: 0.2.2  
vtk: 9.1.0  
PyQt5: 5.15.4  
ipympl: 0.8.7  
mne\_qt\_browser: 0.1.7  
pooch: v1.6.0  
QLibraryPrivate::unload succeeded on “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so”  
QLibraryPrivate::unload succeeded on “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so”  
QLibraryPrivate::unload succeeded on “Xcursor” (faked)

dont know how to solve :(((((

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 10, 2022, 12:17pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/5 "2022-02-10T12:17:04Z")

</div>

Pinging @richard as he may know what is wrong.  
@CliffordTHU, so you manage to create the mne env in the end, right? Do you activate this environment (`conda activate mne`) before you try the mne.sys\_info() command?

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 10, 2022, 12:18pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/6 "2022-02-10T12:18:43Z")

</div>

Judging from the output it seems you did not activate the mne environment as the executable is ` /opt/miniconda3/envs/py37/bin/python`.

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 12:19pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/7 "2022-02-10T12:19:20Z")

</div>

yes,which shows:  
[root@xxx ~]# conda activate mne  
Could not find conda environment: mne  
You can list all discoverable environments with `conda info --envs`.

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 12:20pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/8 "2022-02-10T12:20:39Z")

</div>

[root@xxx ~]# conda info --envs

# conda environments:

# 

base \* /opt/miniconda3  
py37 /opt/miniconda3/envs/py37

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 10, 2022, 12:21pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/9 "2022-02-10T12:21:14Z")

</div>

@CliffordTHU Ok, so you couldn’t install the mne environment, right? Did it take too long (you previously said that conda was stuck on solving environment) or did you get some conflict errors?

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 12:24pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/10 "2022-02-10T12:24:11Z")

</div>

sorry I iddnt understand, I need to install mne environment first then run my python programme, is it right?  
Then how can I install mne environment? Is it installed in linux system but not python?

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 12:26pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/11 "2022-02-10T12:26:33Z")

</div>

“(py37) [root@i]# conda create --name=mne --channel=conda-forge mne”  
It truly takes a long time but succeed at last.

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 12:36pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/12 "2022-02-10T12:36:23Z")

</div>

(py37) [root@xxx ~]# conda create --name=mne --channel=conda-forge mne  
Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 10, 2022, 12:50pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/13 "2022-02-10T12:50:01Z")

</div>

ok, make sure you accept the installation (user input like `y` (from “yes”) may be required). Then activate mne:

```python
conda activate mne

```

and only then see if things work.

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 2:21pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/15 "2022-02-10T14:21:04Z")

</div>

Still

(py37) [root@xxx~]# conda create --name=mne --channel=conda-forge mne  
Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done  
Solving environment: - (py37) [root@xxx ~]# conda activate mne  
Could not find conda environment: mne  
You can list all discoverable environments with `conda info --envs`.

☹

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 10, 2022, 2:30pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/16 "2022-02-10T14:30:45Z")

</div>

You’d have to write exactly what happens setp by step - currently it is difficult to know what is wrong, as it seems you copy only parts of the console messages. Did you get any warnings or errors when trying to install?

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 10, 2022, 2:38pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/17 "2022-02-10T14:38:34Z")

</div>

steps:  
1、I installed python3.7 and pip those packages, and the list:  
Platform: Linux-5.10.60-9.al8.x86\_64-x86\_64-with-centos-3-Soaring\_Falcon  
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]  
Executable: /opt/miniconda3/envs/py37/bin/python  
CPU: x86\_64: 2 cores  
Memory: 3.6 GB

mne: 0.24.1  
numpy: 1.21.5 {blas=openblas, lapack=openblas}  
scipy: 1.7.3  
matplotlib: 2.2.2 {backend=TkAgg}

sklearn: 1.0.2  
numba: 0.55.1  
nibabel: 3.2.1  
nilearn: 0.9.0  
dipy: 1.4.1  
cupy: Not found  
pandas: 1.3.5  
mayavi: 4.7.4  
pyvista: 0.33.2 {OpenGL 3.1 Mesa 20.3.3 via llvmpipe (LLVM 11.0.0, 256 bits)}  
pyvistaqt: 0.7.0  
ipyvtklink: 0.2.2  
vtk: 9.1.0  
PyQt5: 5.15.4  
ipympl: 0.8.7  
mne\_qt\_browser: 0.1.7  
pooch: v1.6.0  
QLibraryPrivate::unload succeeded on “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so”  
QLibraryPrivate::unload succeeded on “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so”  
QLibraryPrivate::unload succeeded on “Xcursor” (faked)

when I run 'python -c “import mne; mne.sys\_info()”, it will comes with some errors, and I will put it on next comment

2、I installed mne-python by ‘(py37) [root@xxx~]# conda create --name=mne --channel=conda-forge mne’, and it shows ‘Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done’  
3、I run my programme and shows cannot import brain from surfer

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 10, 2022, 7:22pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/19 "2022-02-10T19:22:37Z")

</div>

You don’t have to complete the step 1 you describe, you only need anaconda or miniconda, to be able to perfrom step 2. However, your description of step 2 is incomplete. The installation didn’t even begin in your description of step 2. There should be another “Solving environment” (hopefully successful) information and then a list of packages that will be installed that you would have to accept by pressing “y”. Then there would be progress bars as the packages are downloaded and finally everything would be installed.  
Maybe you close the console / command prompt too soon and don’t allow the installation to progress?

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 11, 2022, 1:36am UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/20 "2022-02-11T01:36:20Z")

</div>

Sorry, this account is a new account which means I can only comment 13 messages per day,

actually this is all I got:  
(There do have some errors at last)

(py37) [root@xxx ~]# conda create --name=mne --channel=conda-forge mne  
Collecting package metadata (current\_repodata.json): done  
Solving environment: failed with repodata from current\_repodata.json, will retry with next repodata source.  
Collecting package metadata (repodata.json): done  
Solving environment: - (py37) [root@xxx~]# conda activate mne  
Could not find conda environment: mne  
You can list all discoverable environments with `conda info --envs`.

(py37) [root@ixxx~]# conda info --envs

# conda environments:

# 

base /opt/miniconda3  
py37 \* /opt/miniconda3/envs/py37

(py37) [root@ixxx~]# python -c “import mne; mne.sys\_info()”  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms” …  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqeglfs.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqeglfs.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“eglfs”  
]  
},  
“archreq”: 0,  
“className”: “QEglFSIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“eglfs”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqlinuxfb.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqlinuxfb.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“linuxfb”  
]  
},  
“archreq”: 0,  
“className”: “QLinuxFbIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“linuxfb”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqminimal.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqminimal.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“minimal”  
]  
},  
“archreq”: 0,  
“className”: “QMinimalIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“minimal”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqminimalegl.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqminimalegl.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“minimalegl”  
]  
},  
“archreq”: 0,  
“className”: “QMinimalEglIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“minimalegl”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqoffscreen.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqoffscreen.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“offscreen”  
]  
},  
“archreq”: 0,  
“className”: “QOffscreenIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“offscreen”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqvnc.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqvnc.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“vnc”  
]  
},  
“archreq”: 0,  
“className”: “QVncIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“vnc”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-egl.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-egl.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“wayland-egl”  
]  
},  
“archreq”: 0,  
“className”: “QWaylandEglPlatformIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“wayland-egl”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-generic.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-generic.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“wayland”  
]  
},  
“archreq”: 0,  
“className”: “QWaylandIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“wayland”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-egl.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“wayland-xcomposite-egl”  
]  
},  
“archreq”: 0,  
“className”: “QWaylandXCompositeEglPlatformIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“wayland-xcomposite-egl”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-glx.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“wayland-xcomposite-glx”  
]  
},  
“archreq”: 0,  
“className”: “QWaylandXCompositeGlxPlatformIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“wayland-xcomposite-glx”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwebgl.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqwebgl.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“webgl”  
]  
},  
“archreq”: 0,  
“className”: “QWebGLIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“webgl”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3”,  
“MetaData”: {  
“Keys”: [  
“xcb”  
]  
},  
“archreq”: 0,  
“className”: “QXcbIntegrationPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“xcb”)  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/bin/platforms” …  
loaded library “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so”  
loaded library “Xcursor”  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platformthemes” …  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platformthemes/libqgtk3.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platformthemes/libqgtk3.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1”,  
“MetaData”: {  
“Keys”: [  
“gtk3”  
]  
},  
“archreq”: 0,  
“className”: “QGtk3ThemePlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“gtk3”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platformthemes/libqxdgdesktopportal.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platformthemes/libqxdgdesktopportal.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1”,  
“MetaData”: {  
“Keys”: [  
“xdgdesktopportal”,  
“flatpak”,  
“snap”  
]  
},  
“archreq”: 0,  
“className”: “QXdgDesktopPortalThemePlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“xdgdesktopportal”, “flatpak”, “snap”)  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/bin/platformthemes” …  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts” …  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1”,  
“MetaData”: {  
“Keys”: [  
“compose”,  
“xim”  
]  
},  
“archreq”: 0,  
“className”: “QComposePlatformInputContextPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“compose”, “xim”)  
QFactoryLoader::QFactoryLoader() looking at “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so”  
Found metadata in lib /opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so, metadata=  
{  
“IID”: “org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1”,  
“MetaData”: {  
“Keys”: [  
“ibus”  
]  
},  
“archreq”: 0,  
“className”: “QIbusPlatformInputContextPlugin”,  
“debug”: false,  
“version”: 331520  
}

Got keys from plugin meta data (“ibus”)  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/bin/platforminputcontexts” …  
loaded library “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so”  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/styles” …  
QFactoryLoader::QFactoryLoader() checking directory path “/opt/miniconda3/envs/py37/bin/styles” …  
/opt/miniconda3/envs/py37/lib/python3.7/site-packages/traits/etsconfig/etsconfig.py:412: UserWarning: Environment variable “HOME” not set, setting home directory to /tmp  
% (environment\_variable, parent\_directory)  
2022-02-10 22:36:46.627 ( 9.244s) [427A31C0] vtkShaderProgram.cxx:452 ERR| vtkShaderProgram (0x55f4c762be90): 1:  
2: #version 140  
3: #ifdef GL\_ES  
4: #ifdef GL\_FRAGMENT\_PRECISION\_HIGH  
5: precision highp float;  
6: precision highp sampler2D;  
7: precision highp sampler3D;  
8: #else  
9: precision mediump float;  
10: precision mediump sampler2D;  
11: precision mediump sampler3D;  
12: #endif  
13: #define texelFetchBuffer texelFetch  
14: #define texture1D texture  
15: #define texture2D texture  
16: #define texture3D texture  
17: #else // GL\_ES  
18: #define highp  
19: #define mediump  
20: #define lowp  
21: #if **VERSION** == 150  
22: #define texelFetchBuffer texelFetch  
23: #define texture1D texture  
24: #define texture2D texture  
25: #define texture3D texture  
26: #endif  
27: #endif // GL\_ES  
28: #define varying in  
29:  
30: in vec2 texCoord;  
31: uniform sampler2DMS tex;  
32: uniform int samplecount;  
33: out vec4 fragOutput0;  
34:  
35:  
36: void main()  
37: {  
38: float gamma = 2.2;  
39:  
40: // for each sample in the multi sample buffer…  
41: ivec2 itexcoords = ivec2(floor(textureSize(tex) \* texCoord));  
42: vec3 accumulate = vec3(0.0,0.0,0.0);  
43: float alpha = 0.0;  
44:  
45: for (int i = 0; i \< samplecount; i++)  
46: {  
47: vec4 sample = texelFetch(tex, itexcoords, i);  
48: // apply gamma correction and sum  
49: accumulate += pow(sample.rgb, vec3(gamma));  
50: alpha += sample.a;  
51: }  
52:  
53: // divide and reverse gamma correction  
54: accumulate /= float(samplecount);  
55: fragOutput0 = vec4(pow(accumulate, vec3(1.0/gamma)), alpha/float(samplecount));  
56: }  
57:

ERROR:root:1:  
2022-02-10 22:36:46.628 ( 9.245s) [427A31C0] vtkShaderProgram.cxx:453 ERR| vtkShaderProgram (0x55f4c762be90): 0:31(22): error: syntax error, unexpected NEW\_IDENTIFIER, expecting ‘{’

ERROR:root:error: syntax error, unexpected NEW\_IDENTIFIER, expecting ‘{’  
2022-02-10 22:36:46.629 ( 9.245s) [427A31C0]vtkOpenGLVertexArrayObj:265 ERR| vtkOpenGLVertexArrayObject (0x55f4c76f6b70): attempt to add attribute without a program for attribute ndCoordIn  
ERROR:root:attempt to add attribute without a program for attribute ndCoordIn  
2022-02-10 22:36:46.629 ( 9.246s) [427A31C0]vtkOpenGLQuadHelper.cxx:62 WARN| Error binding ndCoords to VAO.  
2022-02-10 22:36:46.629 ( 9.246s) [427A31C0]vtkOpenGLRenderWindow.c:1102 ERR| vtkXOpenGLRenderWindow (0x55f4c6a7efe0): Couldn’t build the shader program for resolving msaa.  
ERROR:root:Couldn’t build the shader program for resolving msaa.  
Platform: Linux-5.10.60-9.al8.x86\_64-x86\_64-with-centos-3-Soaring\_Falcon  
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]  
Executable: /opt/miniconda3/envs/py37/bin/python  
CPU: x86\_64: 2 cores  
Memory: 3.6 GB

mne: 0.24.1  
numpy: 1.21.5 {blas=openblas, lapack=openblas}  
scipy: 1.7.3  
matplotlib: 2.2.2 {backend=TkAgg}

sklearn: 1.0.2  
numba: 0.55.1  
nibabel: 3.2.1  
nilearn: 0.9.0  
dipy: 1.4.1  
cupy: Not found  
pandas: 1.3.5  
mayavi: 4.7.4  
pyvista: 0.33.2 {OpenGL 3.1 Mesa 20.3.3 via llvmpipe (LLVM 11.0.0, 256 bits)}  
pyvistaqt: 0.7.0  
ipyvtklink: 0.2.2  
vtk: 9.1.0  
PyQt5: 5.15.4  
ipympl: 0.8.7  
mne\_qt\_browser: 0.1.7  
pooch: v1.6.0  
QLibraryPrivate::unload succeeded on “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so”  
QLibraryPrivate::unload succeeded on “/opt/miniconda3/envs/py37/lib/python3.7/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so”  
QLibraryPrivate::unload succeeded on “Xcursor” (faked)

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [February 11, 2022, 11:45pm UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/21 "2022-02-11T23:45:34Z")

</div>

To clarify, in case my previous instructions were confusing:

- the python command (trying to show `mne.sys_info()`) you are using is evaluated in your py27 environment where you seem to have some dependency conflict. You could try fixing that conflict (maybe updating pysurfer would be enough), but my suggestion was to make sure that you are able to install a new mne environment along the installation instructions in the docs
- installing that environment does not seem to work, as new `mne` conda env is not created and the conda install progress that you paste seems to stop at some point. Because this point is recommended in the docs it would be good to know why it fails for you

To make it clearer how installation should work, a copy from just a part of installation progress for a new mne env I created today (last one got tangled in dependency conflicts). This is not exactly the same command as the one you should be running but the output should be similar:

```python
(base) C:\src>conda env create --file environment.yml --name mnedev
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 4.10.3
  latest version: 4.11.0

Please update conda by running

    $ conda update -n base -c defaults conda

Downloading and Extracting Packages
charls-2.2.0 | 93 KB | ############################################################################ | 100%
jbig-2.1 | 45 KB | ############################################################################ | 100%
libtiff-4.3.0 | 1.1 MB | ############################################################################ | 100%
numba-0.53.1 | 3.7 MB | ############################################################################ | 100%
pyvistaqt-0.7.0 | 166 KB | ############################################################################ | 100%
nomkl-1.0 | 4 KB | ############################################################################ | 100%
libopenblas-0.3.18 | 5.5 MB | ############################################################################ | 100%
utfcpp-3.2.1 | 11 KB | ############################################################################ | 100%
libwebp-base-1.2.2 | 393 KB | ############################################################################ | 100%
pydicom-2.2.2 | 1.4 MB | ############################################################################ | 100%
tifffile-2022.2.9 | 140 KB | ############################################################################ | 100%
h5py-3.3.0 | 1.1 MB | ############################################################################ | 100%
deprecated-1.2.13 | 12 KB | ############################################################################ | 100%
importlib_metadata-4 | 4 KB | ############################################################################ | 100%
nibabel-3.2.2 | 2.7 MB | ############################################################################ | 100%
xorg-libxau-1.0.9 | 57 KB | ############################################################################ | 100%
mffpy-0.7.0 | 87 KB | ############################################################################ | 100%
win32_setctime-1.1.0 | 7 KB | ############################################################################ | 100%
zstd-1.5.2 | 1010 KB | ############################################################################ | 100%
threadpoolctl-3.1.0 | 18 KB | ############################################################################ | 100%
tbb-devel-2020.2 | 2.3 MB | ############################################################################ | 100%
pthread-stubs-0.4 | 6 KB | ############################################################################ | 100%
pyreadline-2.1 | 147 KB | ############################################################################ | 100%
gl2ps-1.4.2 | 74 KB | ############################################################################ | 100%

```

and so it goes - multiple packages are installed into the new environement.  
That’s why I wanted to investigate what exactly happens in your case:

- whether conda install command hangs and you have to close it (close the console or kill the process by ctrl+c for example)
- or maybe the command print exactly what you paste and then silently returns you controle of the console without installing the mne evironment (that would be surprising)
- or maybe something else happens, an error is displayed for example (but I’m not referring to any errors later on - you get an error later because the mne env is not present, it cannot be activated and the python code is not evaluated in a new mne env)?

---

<div class="post-metadata">

**Author:** ![CliffordTHU](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cliffordthu/32/1226_2.png) [@CliffordTHU](https://mne.discourse.group/u/CliffordTHU)\
**Post date:** [February 12, 2022, 3:02am UTC](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390/22 "2022-02-12T03:02:53Z")

</div>

I tried to install 2d mne-python and it succeed, somehow 3d can not install:

```python
(py37) [root@xxx ~]# conda update -n base -c defaults conda
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

(py37) [root@xxx ~]# conda info --envs
# conda environments:
#
base /opt/miniconda3
new_environment_name /opt/miniconda3/envs/new_environment_name
py37 * /opt/miniconda3/envs/py37

```

[Next page](https://mne.discourse.group/t/how-to-solve-can-not-import-name-brain-from-surfer/4390.md?page=2)
