[Numpy-discussion] question about standalone small software and teaching

vallis.35530053@blogline... vallis.35530053@blogline...
Wed Apr 4 16:24:14 CDT 2007

Hello Gael (numpy friends),

I'd love to use Traits and TraitsUI. It looks
like a very promising approach. But why is it so difficult to install? If
I download the source from http://code.enthought.com/traits/, and follow the
instructions in enthought.traits-1.1.0/README, and then run the "code snippet
#1" in your tutorial, I get

--- begin error message ---

DeprecationWarning: The wxPython compatibility package is no longer automatically
generated or activly maintained.  Please switch to the wx package as soon
as possible.
  from wxPython.wx import *
Traceback (most recent call last):

  File "prova.py", line 23, in ?
  File "enthought/traits/has_traits.py",
line 1871, in configure_traits
  File "/Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/wx/toolkit.py",
line 134, in view_application
    import view_application
  File "/Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/wx/view_application.py",
line 29, in ?
    from enthought.debug.fbi \
  File "/Users/vallis/Desktop/enthought.traits-1.1.0/enthought/debug/fbi.py",
line 257, in ?
    auto_size          = False
  File "/Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/editors.py",
line 196, in TableEditor
    return toolkit().table_editor( *args, **traits
  File "/Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/wx/toolkit.py",
line 514, in table_editor
    return te.ToolkitEditorFactory( *args, **traits
  File "/Users/vallis/Desktop/enthought.traits-1.1.0/enthought/traits/ui/editor_factory.py",
line 55, in __init__
    HasPrivateTraits.__init__( self, **traits )
"enthought/traits/trait_handlers.py", line 172, in error
The 'selection_color' trait of a ToolkitEditorFactory instance must be a wx.Colour
instance, an integer which in hex is of the form 0xRRGGBB, where RR is red,
GG is green, and BB is blue, but a value of black was specified.

--- end
error message ---

BTW, I'm using Python 2.4.4 on Macintel, with wxPython-2.8.0.

If I get the latest SVN of the enthought tool suite, go to enthought/src/lib/enthought/traits,
and build with

python setup.py build_src build_clib build_ext --inplace

as suggested in the enthought wiki, and then add enthought/src/lib to my
PYTHONPATH, then your snippet fails with

--- begin error message ---

Traceback (most recent call last):
  File "prova.py", line 5, in ?
class Camera(HasTraits):
NameError: name 'HasTraits' is not defined

end error message ---

Last, I see that matplotlib includes some enthought/traits
code, but not the ui frontends. Why is that? Is the matplotlib traits usable?

As you can see, I'm very confused... if only there was a traits Python



--- Discussion of Numerical Python <numpy-discussion@scipy.org
You can do a script with a GUI front end, as described in the first

> chapter of my tutorial
> http://gael-varoquaux.info/computers/traits_tutorial/traits_tutorial.html

> . You can also build a complete interactive application, as described in

> the rest of the tutorial, but this is more work.
> If you have more
questions about this approach feal free to ask.
> Ga�l
> _______________________________________________

> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion


More information about the Numpy-discussion mailing list