MICA-MNI / ENIGMA

The ENIGMA Toolbox is an open-source repository for accessing 100+ ENIGMA statistical maps, visualizing cortical and subcortical surface data, and relating neuroimaging findings to micro- and macroscale brain organization. 🤠
https://enigma-toolbox.readthedocs.io
BSD 3-Clause "New" or "Revised" License
129 stars 31 forks source link

ImportError: cannot import name 'VTK_UNICODE_STRING' from 'vtk.util.vtkConstants' when importing load_summary_stats #15

Closed WMDA closed 2 years ago

WMDA commented 2 years ago

Hi

I am getting this import error ImportError: cannot import name 'VTK_UNICODE_STRING' from 'vtk.util.vtkConstants' when I try to import from enigmatoolbox.datasets import load_summary_stats

This happens in python 3.8 and python 3.9 on a linux ubuntu and linux redhat distros

It looks like VTK_UNICODE_STRING is depreciated (https://gitlab.kitware.com/vtk/vtk/-/issues/18327) and there is definitely no VTK_UNICODE_STRING in vtk.util.vtkConstants.

I can do everything I want to do by from vtk.util.vtkConstants import VTK_STRING#, VTK_UNICODE_STRING in the vtk.wrappers.utils file and was going to issue a pull request however saw this then effects the is_vtk_string() function in that file which seems to be used all over vtk.interface and my pull request would probably break everything.

Thanks

joebathelt commented 2 years ago

I managed to get around that error by downgrading vtk to version 9.1.0:

pip install --upgrade vtk==9.1.0
saratheriver commented 2 years ago

Noice - thank you beautiful people 😇 The toolbox was only tested on python 3.7 so I appreciate you pointing out these bugs + fixes!