On Thu, May 24, 2012 at 8:52 PM, 爱勇王 <[email protected]> wrote:
> It's very glad to get response and excited to see someone has made it
> worded.
> I've looked up in that new opened issue, but another error occurs.
> Since it may not be related, I felt inappropriate to require help in that
> issue.
>
> My error is:
> In spyder's console,
> from enthought.mayavi import mlab
> get a long list of error description:
>
> >>> from enthought.mayavi import mlab
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "C:\Python27\lib\site-packages\enthought\mayavi\mlab.py", line 3,
> in <module>
> from mayavi.mlab import *
> File "C:\Python27\lib\site-packages\mayavi\mlab.py", line 27, in <module>
> from mayavi.tools.camera import view, roll, yaw, pitch, move
> File "C:\Python27\lib\site-packages\mayavi\tools\camera.py", line 23, in
> <module>
> from engine_manager import get_engine
> File "C:\Python27\lib\site-packages\mayavi\tools\engine_manager.py",
> line 12, in <module>
> from mayavi.preferences.api import preference_manager
> File "C:\Python27\lib\site-packages\mayavi\preferences\api.py", line 4,
> in <module>
> from preference_manager import preference_manager
> File
> "C:\Python27\lib\site-packages\mayavi\preferences\preference_manager.py",
> line 29, in <module>
> from traitsui.api import View, Group, Item
> File "C:\Python27\lib\site-packages\traitsui\api.py", line 35, in
> <module>
> from .editors.api import (ArrayEditor, BooleanEditor, ButtonEditor,
> File "C:\Python27\lib\site-packages\traitsui\editors\__init__.py", line
> 22, in <module>
> from .api import (toolkit, ArrayEditor, BooleanEditor, ButtonEditor,
> File "C:\Python27\lib\site-packages\traitsui\editors\api.py", line 10,
> in <module>
> from .code_editor import CodeEditor
> File "C:\Python27\lib\site-packages\traitsui\editors\code_editor.py",
> line 36, in <module>
> class ToolkitEditorFactory ( EditorFactory ):
> File "C:\Python27\lib\site-packages\traitsui\editors\code_editor.py",
> line 48, in ToolkitEditorFactory
> mark_color = Color( 0xECE9D8 )
> File "C:\Python27\lib\site-packages\traits\traits.py", line 486, in
> __call__
> return self.maker_function( *args, **metadata )
> File "C:\Python27\lib\site-packages\traits\traits.py", line 1182, in
> Color
> return ColorTrait( *args, **metadata )
> File "C:\Python27\lib\site-packages\traitsui\toolkit_traits.py", line 7,
> in ColorTrait
> return toolkit().color_trait( *args, **traits )
> File "C:\Python27\lib\site-packages\traitsui\toolkit.py", line 109, in
> toolkit
> _toolkit = _import_toolkit(ETSConfig.toolkit)
> File "C:\Python27\lib\site-packages\traitsui\toolkit.py", line 51, in
> _import_toolkit
> return __import__( name, globals=globals(), level=1 ).toolkit
> File "C:\Python27\lib\site-packages\traitsui\qt4\__init__.py", line 18,
> in <module>
> import pyface.qt
> File "C:\Python27\lib\site-packages\pyface\qt\__init__.py", line 35, in
> <module>
> prepare_pyqt4()
> File "C:\Python27\lib\site-packages\pyface\qt\__init__.py", line 17, in
> prepare_pyqt4
> sip.setapi('QString', 2)
> ValueError: API 'QString' has already been set to version 1
> >>>
>
> but in spyder's console, if switched to IPython interpreter, it works fine
> without error.
> I've tested it works fine in the python interpreter under my windows xp
> sp3 console window.
>
Please try setting the Qt API to version 2 by doing the following in Spyder:
Tools..Preferences..Console..External Modules
Set the "API selection for QString and QVariant objects" pull down to "API
#2"
Close the dialog with OK.
After making this setting change, open a new Python console and try
importing mlab.
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/spyderlib?hl=en.