3

I downloaded the Enthought Tool Suite through this website: http://code.enthought.com/downloads/.

When I write put this code in the python script:

from traits.api import HasTraits, Str, Int
from traitsui.api import View, Item
from traitsui.menu import OKButton, CancelButton

class SimpleEmployee(HasTraits):
    first_name = Str
    last_name = Str
    department = Str

    employee_number = Str
    salary = Int

view1 = View(Item(name = 'first_name'),
             Item(name = 'last_name'),
             Item(name = 'department'),
             buttons = [OKButton, CancelButton])

sam = SimpleEmployee()
sam.configure_traits(view=view1)

I got an error that says:

"ImportError: No module named traits.api "

How do I remedy this? I don't know what I'm missing. Please help me!

user1539217
  • 85
  • 3
  • 10

1 Answers1

3

If I am not mistaken, you will need to compile the Enthought tool suite after downloading, which is not always easy.

I would suggest that you try installing the Enthought Python distribution Free which you can get here: http://www.enthought.com/products/epd_free.php

That way you should have all the necessary packages installed by default.

EDIT:

If you absolutely want to keep the default python distribution, this guy here has compiled a list of useful python packages with easy windows installers.

Furthermore there are very complete python distributions out there which come with almost all the scientific package you could need: PythonXY (although this is only 32bit), then there is the Continuum Anaconda distribution which has been gaining a lot of ground.

Ben K.
  • 1,160
  • 6
  • 20
  • The Enthought Python distribution does not share packages to my default Python distribution. Or I am doing something wrong... – strpeter Dec 19 '14 at 15:47
  • No, you are right, the EPD, which is now Canopy, is its own python distribution and it does not play nice with other python distributions innstalled in parallel. I will extend my answer with what I have learnt over time... – Ben K. Dec 22 '14 at 07:52