Comments (6)
The real issue is a problem occurs earlier, see the following line:
/Users/dac49596/anaconda3/envs/eelbrain0386/lib/python3.10/site-packages/eelbrain/plot/_brain_object.py:49: UserWarning: Error importing PySurfer: cannot import name 'Sequence' from 'collections' (/Users/dac49596/anaconda3/envs/eelbrain0386/lib/python3.10/collections/__init__.py)
This (admittedly vague) warning is issued when the following initialization fails:
from traits.trait_base import ETSConfig
if use_inline_backend() or not CONFIG['eelbrain']:
ETSConfig.toolkit = 'qt'
INLINE_DISPLAY = True
from mayavi import mlab
mlab.options.offscreen = True
else:
ETSConfig.toolkit = 'wx'
import surfer
What's strange is the actual error (cannot import name 'Sequence' from 'collections'
).
Can you try to run the following in your environment?
from traits.trait_base import ETSConfig
ETSConfig.toolkit = 'wx'
import surfer
from eelbrain.
Hi Christian,
Yes, I tried 'from surfer import Brain' and got the same error; I should have mentioned that as well.
I tried the code that you gave me. Unfortunately, I'm seeing the same thing:
(Thanks for the really fast response!!)
In [1]: from traits.trait_base import ETSConfig
In [2]: ETSConfig.toolkit = 'wx'
In [3]: import surfer
2023-05-04 20:01:05.067 python[30876:852374] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/mr/79qm2pcs3f76pkqdnd_pwfzml0x6yh/T/com.continuum.python.savedState
<frozen importlib._bootstrap>:241: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 96 from PyObject
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[3], line 1
----> 1 import surfer
File ~/anaconda3/envs/eelbrain0.38.4/lib/python3.10/site-packages/surfer/__init__.py:1
----> 1 from .viz import Brain, TimeViewer # noqa
2 from .utils import Surface, verbose, set_log_level, set_log_file # noqa
3 from .io import project_volume_data # noqa
File ~/anaconda3/envs/eelbrain0.38.4/lib/python3.10/site-packages/surfer/viz.py:25
22 from pyface.api import GUI
23 from traitsui.api import View, Item, Group, VGroup, HGroup, VSplit, HSplit
---> 25 from . import utils, io
26 from .utils import (Surface, verbose, create_color_lut, _get_subjects_dir,
27 string_types, threshold_filter, _check_units)
30 logger = logging.getLogger('surfer')
File ~/anaconda3/envs/eelbrain0.38.4/lib/python3.10/site-packages/surfer/utils.py:1
----> 1 from collections import Sequence
2 from distutils.version import LooseVersion
3 import logging
ImportError: cannot import name 'Sequence' from 'collections' (/Users/dac49596/anaconda3/envs/eelbrain0.38.4/lib/python3.10/collections/__init__.py)```
from eelbrain.
Looks like pysurfer is overdue for an update
This is from Python 3.9:
>>> from collections import Sequence
<ipython-input-6-8844d1891ca7>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import Sequence
For now, if you create an environment with Python 3.9 you should be able to proceed.
from eelbrain.
Ahhh, it didn't even occur to me to try other python versions.
Thanks so much for your help! I'll try it with python3.9 and report back
from eelbrain.
PySurfer PR (and branch) on which this should be fixed, in case you want to try: nipy/PySurfer#320
from eelbrain.
PySurfer is now updated to 0.11.1 which should fix this.
from eelbrain.
Related Issues (20)
- Loading CND format dataset with load.cnd HOT 4
- Trouble adding NDVar to brain plot HOT 3
- calling plot functions in eelbrain cause python to abort (libc++abi: terminating with uncaught exception of type NSException) HOT 3
- Adding parcellation to vol source space HOT 2
- Boosting residual defined for individual eeg channels, but documentation states otherwise. HOT 1
- trouble getting same residuals with BoostingResult and Convolve HOT 15
- Differing results for Spatio-temporal cluster permutation in Mac vs. Windows HOT 15
- How should I import my meg raw file into eelbrain's NDVar format? HOT 11
- Cannot install eelbrain 0.39.5 HOT 10
- Having a dead kernel each time I run eelbrain on my data HOT 7
- Does eelbrain works with Mac M2 chip HOT 1
- Under-utilization of CPU on M1 Ultra during boosting HOT 3
- Eelbrain doesn't lauch after update HOT 5
- MNE Deprecations HOT 1
- The math under TTestRelated HOT 1
- plot.brain.brain(roi) crashes immediately HOT 2
- Missing dependencies keyring, wxPython, colormath, pymatreader HOT 2
- Improve documentation and/or GitHub readme HOT 5
- ICA GUI toggles wrong component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eelbrain.