title: Freezing (.exe) a traitsUI program, realistically feasible?
body: <p>I'm trying to freeze with either cx_freeze or pyInstaller a TraitsUI program that makes use of Chaco, Traits, TraitsUI and to a lesser extent mayavi (could actually be taken out).  I need this to run on mac, linux, ubuntu so am avoiding py2exe.  <strong>I've intentionally uninstalled pyqt and pyside so that only the wx backend is available.</strong>  </p>
  
  <p>Using cx_freeze, I encountered and reported a bug, so pyInstaller seems to be getting me the furthest.  It generated an .exe file, but when I run the file I get warnings and an error.  To generate the .exe file I did:</p>
  
  <pre><code>pyinstaller --onefile --name=pameapp pamemain.py 
  pyinstaller pameapp.exe
  </code></pre>
  
  <p>Upon running, the warnings are:</p>
  
  <pre><code>Warning: Unable to import the wx backend for pyface due to traceback: Traceback (most recent call last):
        File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/pyface.toolkit", line 45, in _init_toolkit
        File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/pyface.toolkit", line 31, in import_toolkit
      ImportError: No module named wx.init
  
  Warning: Unable to import the qt4 backend for pyface due to traceback: Traceback (most recent call last):
        File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/pyface.toolkit", line 45, in _init_toolkit
        File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/pyface.toolkit", line 31, in import_toolkit
      ImportError: No module named init
  
  Warning: Unable to import the null backend for pyface due to traceback: Traceback (most recent call last):
        File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/pyface.toolkit", line 45, in _init_toolkit
        File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/pyface.toolkit", line 31, in import_toolkit
      ImportError: No module named null.init
  </code></pre>
  
  <p>In addition, I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 8, in &lt;module&gt;
    File "/home/glue/anaconda/envs/fibersim/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.api", line 35, in &lt;module&gt;
    File "/home/glue/anaconda/envs/fibersim/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.editors", line 22, in &lt;module&gt;
    File "/home/glue/anaconda/envs/fibersim/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.editors.api", line 10, in &lt;module&gt;
    File "/home/glue/anaconda/envs/fibersim/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module
      exec(bytecode, module.__dict__)
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.editors.code_editor", line 36, in &lt;module&gt;
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.editors.code_editor", line 48, in ToolkitEditorFactory
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traits.traits", line 487, in __call__
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traits.traits", line 1191, in Color
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.toolkit_traits", line 7, in ColorTrait
    File "/home/glue/Desktop/fibersim/pame/build/pameapp/out00-PYZ.pyz/traitsui.toolkit", line 137, in toolkit
  traits.trait_errors.TraitError: Could not find any UI toolkit called 'null'
  </code></pre>
  
  <p>pyface probably has a lot of dynamic imports, so this must be a problem encountered by anyone who tries to freeze ETS.  Is there a single fix to get this working?</p>
  
  <p>Considering the older stuff floating around the web on success rates to freezing an ETS program, is it even worth further investment?  To us, having people avoid configuring python for this application would be a huge plus.</p>
  
  <p>Thanks.</p>