title: creating standalone exe using pyinstaller with mayavi import
body: <p>I have a program that helps visualize some data in 3D by plotting a surface and a cloud of points to see how they relate to the surface. For the visualization I am using mayavi since it was easy to set up and does a better job than matplotlib in 3D. The program works great when I run it in my python environment and makes beautiful visualizations. However, I need to distribute this to a few people who don't have Python and would prefer not to have to install python and all the add-ins on each computer, so I have been using pyinstaller to create standalone .exe files that they can run after I develop a program. </p>
  
  <p>For reference, this is all done on Windows 10, Python 3.6, pyqt 4.11.4, pyface 6.0.0, traits 4.6.0, pyinstaller 3.3.1, mayavi 4.5.0+vtk81. Just about every module I use was installed using pip.</p>
  
  <p>The problem is that I can't seem to get a working exe if I use/import the mayavi module. I have been reading so much github documentation on different hook files and hidden-imports and each time I fix one error another pops up. It all started with scipy but I believe I have those worked out. So I have a few questions that could help me solve the problem:</p>
  
  <p>1) Has anyone successfully created a standalone exe using pyinstaller with a mayavi import (specifically <code>from mayavi import mlab</code>)? What is your secret?!?</p>
  
  <p>This seems similar but I haven't been able to figure it out yet... <a href="https://stackoverflow.com/questions/28079792/freezing-exe-a-traitsui-program-realistically-feasible">SO_link</a></p>
  
  <p>I have used the following links (<a href="https://github.com/pyinstaller/pyinstaller/issues/2987" rel="nofollow noreferrer">scipy</a>,<a href="https://github.com/pyinstaller/pyinstaller/issues/1465" rel="nofollow noreferrer">h5py</a>,<a href="https://github.com/pyinstaller/pyinstaller/pull/2998/files" rel="nofollow noreferrer">pandas</a>,<a href="https://stackoverflow.com/questions/15249134/pyinstaller-and-enthought-suite">traits/qt4</a>,<a href="http://docs.enthought.com/pyface/" rel="nofollow noreferrer">ETS_TOOLKIT</a>) to add hidden imports or fix other issues but I am stuck now after setting my ETS_TOOLKIT=qt4. Before setting it, I would get a pyface/traits error <code>RuntimeError: No traitsui.toolkits plugin found for toolkit null</code>, but now it says the same thing for qt4 instead of null. I have qt4 installed so I don't understand that... It is in the import_toolkit function in pyface/base_toolkit.py.</p>
  
  <p>2) Is there a better route to go in terms of 3D visualization / exe creation? I need a 3D program that can accurately render if the points are in front of or behind the surface and be able to rotate/zoom/pan interactively, plus it needs to be intuitive. Mayavi had very simple commands similar to matplotlib but others seem very complicated working around how the UI interacts with everything.</p>
  
  <p>3) How do I interpret all of these error codes I get? They are usually pretty cryptic saying a certain line threw an exception nested in 10 other function calls and it seems very difficult to back out where exactly things went wrong, especially when nothing pops up on Google that seems to be related.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>While I am still very confused, I have been able to change where the error occurs. Following the traceback, I commented out a line setting the marker color in traitsui/editors/code_editor.py (line 49), at which point the exception then started the next time the Color method was called... but I still get the same RuntimeError. So that doesn't tell me much other than I am still looking for what hidden import I need to include for this thing to work.</p>
  
  <p>Also note that I get the exact same error with both PyInstaller and cx_Freeze, in case that helps...</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>I have now tried it using anaconda for python 2.7, SAME EXACT ISSUE..... I'm starting to believe the universe doesn't want this to happen. Is there somewhere else I should bring this issue up?? I have posted on the traitsui GitHub but that wasn't very helpful. This seems to be bigger than pyinstaller/cx_freeze since it happens in both....</p>