1

I'm trying to install Mayavi for visualizations on my M1 Air. Mayavi has a dependency on VTK - which does not have official binaries for Apple Silicon yet. I tried compiling it from source and updated the paths, but when I do pip install mayavi, I get ModuleNotFoundError: No module named 'vtk'.

Have you had any success?

postmalloc
  • 90
  • 1
  • 8
  • Hello, try like this `brew install vtk` and then `pip install mayavi` you have to have homebrew installed though. – Tony Mar 28 '21 at 14:50
  • Thank you. That is the first thing I tried; still get the same error. – postmalloc Mar 28 '21 at 15:02
  • According to [here](https://stackoverflow.com/questions/12182052/installing-mayavi-with-pip-no-module-named-vtk) maybe pip is using another version of python for the venv. – Tony Mar 28 '21 at 15:08
  • According to [here](https://gitlab.kitware.com/vtk/vtk/-/issues/18158#note_925881) apple M1 is not offically supported by VTK ... – Nico Vuaille Mar 29 '21 at 08:05

2 Answers2

0

Surfice can view many mesh-based formats (including VTK), while MRIcroGL can support many voxel-based formats (including VTK). They are open source and compiled natively for macOS, Linux and Windows. The macOS builds are universal (native x86-64 and Apple Silicon). The programs allow Python scripting (the Scripting menus provide a lot of sample scripts that demonstrate the capability). This may help fill the gap until VTK fully supports the M1.

0

There are some tricks that you can use vtk(pyvtk) pkg in m1 silicon, here are tutorials: 1.have a x86 macbook 2.build vtk environment using homebrew(you can add pyqt et.al) 3.using your new m1 to mirror copy x64 macbook 4.build an environment in your /usr/local/your_python_path 5.enjoy vtk for m1!