Help getting VTK and MAYAVI working on a current macOS system

90 views
Skip to first unread message

Christian

unread,
Oct 6, 2017, 2:29:16 PM10/6/17
to Enthought Tool Suite users
Hi all.

I was just wondering what the status of mayavi is? I'm on macOS using homebrew and things are not smooth here...
I’m struggling to get my old scripts going (some simple plotting using mayavi) on a current Mac 10.12 setup.

I use homebrew for managing my packages and work with homebrew-python 2.7. 

Anyone out there with a current howto to help me get things going? Is there a current HOWTO to set things up without Anaconda?

It seems, that recently homebrew moved from vtk7 to vtk8 and also depreciated Qt4 (I thus want/ haveto to use wx). Using the vtk8 formula mayavi, traitsui et al. complain about a version mismatch...
Vtk was removed from homebrew-science and thus I looked elsewhere...

I managed to get a homebrew formula for vtk 7.1 via https://github.com/RobotLocomotion/homebrew-director  and installed mayavi via pip (also wxpython via homebrew as the backend).

ETS_TOOLKIT=wx is set.

I can run my script but it stalls after 

> from mayavi import mlab

 and if execute the script with verbose mode the last lines are:

# /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_misc.pyc matches /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_misc.py
import wx._misc # precompiled from /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_misc.pyc
# trying /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_misc_.so
dlopen("/usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_misc_.so", 2);
import wx._misc_ # dynamically loaded from /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_misc_.so
# trying /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/signal.so
# trying /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/signalmodule.so
# trying /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/signal.py
# trying /usr/local/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/signal.pyc


Anyone know what’s going on?

Anaconda is not an option for me at the moment unfortunately.

Thanks,
C

Corran Webster

unread,
Oct 9, 2017, 8:17:20 AM10/9/17
to Enthought Tool Suite users
Hi Christian,

I can't give you any advice about getting things set up from scratch using homebrew, or with anaconda, but you can get a working Mayavi on OS X using the Enthought Deployment Manager: http://docs.enthought.com/edm/

Rough steps would be
  1. install edm using the instructions in the link above
  2. create an EDM environment with mayavi, and wxPython and/or PyQt installed, eg edm install mayavi wxpython
  3. switch to the enviornment using, eg. edm shell or run the Mayavi application using eg. edm run mayavi2
This should give you a self-contained environment with a working Mayavi.  You can install anything else you like into that environment, and EDM has a fairly comprehensive set of scientific python packages available.

Hope this is useful.

-- Corran
Reply all
Reply to author
Forward
0 new messages