3

I have a single window/view enaml application (backend is PySide). I have packaged it to .exe using PyInstaller and it finishes successfully but when I run the executable it complains about the module which is in the .enaml file (I have already included the file and the parser in the .spec file, see below). Any thoughts on what goes wrong?

Here is the error from running the .exe file:

Traceback (most recent call last):
  File "colEq.py", line 70, in <module>
    from colEq import CaseView
ImportError: cannot import name CaseView

CaseView is defined in colEq.enaml file and the line referred to is:

with enaml.imports():
   from colEq import CaseView`

My spec file has the following added beyond the default generated by PyInstaller:

a.datas+= [('colEq.enaml', 'colEq.enaml', 'DATA'),
           ('enaml\\core\\parser.py', parser_filepath, 'DATA')]

hiddenimports=[
    "enaml",
    "enaml.core.parse_tab.lextab",
    "enaml.core.compiler_helpers",
    "enaml.core.compiler_nodes",
    "enaml.core.enamldef_meta",
    "enaml.core.template",
    "enaml.widgets.api",
    "enaml.widgets.form",
    "enaml.layout.api",
    "enaml.stdlib.fields"
 ]

The platform is Python 2.7, x86, Win 10.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Mahdi
  • 191
  • 8

0 Answers0