我通过这个网站下载了 Enthought Tool Suite:http ://code.enthought.com/downloads/ 。
当我写的时候把这段代码放在 python 脚本中:
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)
我收到一条错误消息:
“ImportError:没有名为 traits.api 的模块”
我该如何补救?我不知道我错过了什么。请帮我!