Search code examples
pythonenaml

How do I import show_simple_view from enaml.stdlib.sessions?


I'm trying to teach myself Enaml but none of the tutorial code works for me. http://docs.enthought.com/enaml/instructional/tut_hello_world.html

Whenever I execute the Python code, it stops at line 8:

from enaml.stdlib.sessions import show_simple_view

and gives the error:

ImportError: No module named sessions

I have Enaml and all of it's dependencies. What am I doing wrong?


Solution

  • The docs you are looking at are for a very old version of enaml which is quite different than the current version.

    Development of enaml moved several years ago from enthought's github repo to https://github.com/nucleic/enaml, where the current version is 0.9.7, and where you will find more current docs.

    Enthought's free Canopy Express currently includes enaml 0.9.4.

    If you do pip install enaml as suggested by @alfasin, you'll get version 0.9.1 (as of this writing). Anaconda also includes this version.