Hi all
I recently cloned the source from github and all the tests passed. I am trying to run posproc.py on cylinder.vtk and it results in the following errors.
python2 postproc.py cylinder.vtk
Traceback (most recent call last):
File "postproc.py", line 42, in <module>
from sfepy.postprocess import Viewer, get_data_ranges,
create_file_source
File "/mysrc/sfepy/sfepy/postprocess/__init__.py", line 1, in <module>
from viewer import Viewer, ViewerGUI
File "/mysrc/sfepy/sfepy/postprocess/viewer.py", line 19, in <module>
from traitsui.api
File "/usr/lib/python2.7/site-packages/traitsui/api.py", line 35, in
<module>
from .editors.api import (ArrayEditor, BooleanEditor, ButtonEditor,
File "/usr/lib/python2.7/site-packages/traitsui/editors/__init__.py",
line 22, in <module>
from .api import (toolkit, ArrayEditor, BooleanEditor, ButtonEditor,
File "/usr/lib/python2.7/site-packages/traitsui/editors/api.py", line 10,
in <module>
from .code_editor import CodeEditor
File "/usr/lib/python2.7/site-packages/traitsui/editors/code_editor.py",
line 36, in <module>
class ToolkitEditorFactory ( EditorFactory ):
File "/usr/lib/python2.7/site-packages/traitsui/editors/code_editor.py",
line 48, in ToolkitEditorFactory
mark_color = Color( 0xECE9D8 )
File "/usr/lib/python2.7/site-packages/traits/traits.py", line 487, in
__call__
return self.maker_function( *args, **metadata )
File "/usr/lib/python2.7/site-packages/traits/traits.py", line 1191, in
Color
return ColorTrait( *args, **metadata )
File "/usr/lib/python2.7/site-packages/traitsui/toolkit_traits.py", line
7, in ColorTrait
return toolkit().color_trait( *args, **traits )
File "/usr/lib/python2.7/site-packages/traitsui/toolkit.py", line 117, in
toolkit
_toolkit = _import_toolkit( toolkit_name )
File "/usr/lib/python2.7/site-packages/traitsui/toolkit.py", line 51, in
_import_toolkit
return __import__( name, globals=globals(), level=1 ).toolkit
File "/usr/lib/python2.7/site-packages/traitsui/wx/__init__.py", line 26,
in <module>
import toolkit
File "/usr/lib/python2.7/site-packages/traitsui/wx/toolkit.py", line 55,
in <module>
from pyface.wx.drag_and_drop
File "/usr/lib/python2.7/site-packages/pyface/wx/drag_and_drop.py", line
21, in <module>
wxversion.select("2.8")
File "/usr/lib/python2.7/site-packages/wxversion.py", line 144, in select
raise AlreadyImportedError("wxversion.select() must be called before
wxPython is imported")
wxversion.AlreadyImportedError: wxversion.select() must be called before
wxPython is imported
Any ideas?
Regards
jagan
Hi Jagan,
On 02/09/2014 09:58 AM, Jagannathan Tiruvallur Eachambadi wrote:
Hi all
I recently cloned the source from github and all the tests passed. I am trying to run posproc.py on cylinder.vtk and it results in the following errors.
python2 postproc.py cylinder.vtk Traceback (most recent call last): File "postproc.py", line 42, in <module> from sfepy.postprocess import Viewer, get_data_ranges, create_file_source File "/mysrc/sfepy/sfepy/postprocess/__init__.py", line 1, in <module> from viewer import Viewer, ViewerGUI File "/mysrc/sfepy/sfepy/postprocess/viewer.py", line 19, in <module> from traitsui.api
File "/usr/lib/python2.7/site-packages/traitsui/api.py", line 35, in <module> from .editors.api import (ArrayEditor, BooleanEditor, ButtonEditor, File "/usr/lib/python2.7/site-packages/traitsui/editors/__init__.py", line 22, in <module> from .api import (toolkit, ArrayEditor, BooleanEditor, ButtonEditor, File "/usr/lib/python2.7/site-packages/traitsui/editors/api.py", line 10, in <module> from .code_editor import CodeEditor File "/usr/lib/python2.7/site-packages/traitsui/editors/code_editor.py", line 36, in <module> class ToolkitEditorFactory ( EditorFactory ): File "/usr/lib/python2.7/site-packages/traitsui/editors/code_editor.py", line 48, in ToolkitEditorFactory mark_color = Color( 0xECE9D8 ) File "/usr/lib/python2.7/site-packages/traits/traits.py", line 487, in __call__ return self.maker_function( *args, **metadata ) File "/usr/lib/python2.7/site-packages/traits/traits.py", line 1191, in Color return ColorTrait( *args, **metadata ) File "/usr/lib/python2.7/site-packages/traitsui/toolkit_traits.py", line 7, in ColorTrait return toolkit().color_trait( *args, **traits ) File "/usr/lib/python2.7/site-packages/traitsui/toolkit.py", line 117, in toolkit _toolkit = _import_toolkit( toolkit_name ) File "/usr/lib/python2.7/site-packages/traitsui/toolkit.py", line 51, in _import_toolkit return __import__( name, globals=globals(), level=1 ).toolkit File "/usr/lib/python2.7/site-packages/traitsui/wx/__init__.py", line 26, in <module> import toolkit File "/usr/lib/python2.7/site-packages/traitsui/wx/toolkit.py", line 55, in <module> from pyface.wx.drag_and_drop
File "/usr/lib/python2.7/site-packages/pyface/wx/drag_and_drop.py", line 21, in <module> wxversion.select("2.8") File "/usr/lib/python2.7/site-packages/wxversion.py", line 144, in select raise AlreadyImportedError("wxversion.select() must be called before wxPython is imported") wxversion.AlreadyImportedError: wxversion.select() must be called before wxPython is importedAny ideas?
I have not seen this error yet. But I have found the same message in a discussion at [1] - maybe it will help you?
r.
[1] https://mail.enthought.com/pipermail/enthought-dev/2010-February/025433.html
I have not seen this error yet. But I have found the same message in a discussion at [1] - maybe it will help you? r.
[1] https://mail.enthought.com/pipermail/enthought-dev/2010-February/025433.html
I did go through it. It says that some module is importing wx before the version change is performed.
import wxversion ---> 21 wxversion.select("2.8") 22 import wx
Only after the version is selected, wx is imported. It is getting imported before.
Regards jagan
On 02/09/2014 07:22 PM, Jagannathan Tiruvallur Eachambadi wrote:
I have not seen this error yet. But I have found the same message in a discussion at [1] - maybe it will help you? r.
[1] https://mail.enthought.com/pipermail/enthought-dev/2010-February/025433.html
I did go through it. It says that some module is importing wx before the version change is performed.
import wxversion ---> 21 wxversion.select("2.8") 22 import wx
Only after the version is selected, wx is imported. It is getting imported before.
So it does not help much your problem, does it? In that case try asking the enthought-dev mailing list. Btw. if you run mayavi directly (type mayavi2 in the shell), what happens?
r.
So it does not help much your problem, does it? In that case try asking the enthought-dev mailing list. Btw. if you run mayavi directly (type mayavi2 in the shell), what happens?
r.
Mayavi opens without problems. Is there a possibility of opening the vtk file from the mayavi GUI. I opened the file in mayavi but couldn't figure out how to get the plot.
Regards jagan
On 02/10/2014 02:53 AM, Jagannathan Tiruvallur Eachambadi wrote:
So it does not help much your problem, does it? In that case try asking the enthought-dev mailing list. Btw. if you run mayavi directly (type mayavi2 in the shell), what happens?
r.
Mayavi opens without problems. Is there a possibility of opening the vtk file from the mayavi GUI. I opened the file in mayavi but couldn't figure out how to get the plot.
Yes, that should work. But you need to create at least one visualization module in mayave, e.g. Surface (this can be done also from the command line: mayavi2 -d cylinder.vtk -m Surface), and set the data source to correct field.
As for the original problem - do you use WX widgets for both mayavi and matplotlib? If so, try setting (just guessing) the matplotlib backend to something else, as sfepy might import matplotlib somewhere during postproc.py call.
r.
Yes, that should work. But you need to create at least one visualization module in mayave, e.g. Surface (this can be done also from the command line: mayavi2 -d cylinder.vtk -m Surface), and set the data source to correct field.
Works without any problems.
As for the original problem - do you use WX widgets for both mayavi and matplotlib? If so, try setting (just guessing) the matplotlib backend to something else, as sfepy might import matplotlib somewhere during postproc.py call.
I changed the matplolib backend to qt4agg according to < http://matplotlib.org/users/customizing.html#customizing-matplotlib>, I get the same error.
Regards jagan
On 02/10/2014 11:48 AM, Jagannathan Tiruvallur Eachambadi wrote:
Yes, that should work. But you need to create at least one visualization module in mayave, e.g. Surface (this can be done also from the command line: mayavi2 -d cylinder.vtk -m Surface), and set the data source to correct field.
Works without any problems.
Good. You might also want to try paraview for interactive work.
As for the original problem - do you use WX widgets for both mayavi and matplotlib? If so, try setting (just guessing) the matplotlib backend to something else, as sfepy might import matplotlib somewhere during postproc.py call.
I changed the matplolib backend to qt4agg according to < http://matplotlib.org/users/customizing.html#customizing-matplotlib>, I get the same error.
Strange. Unfortunately I cannot help you more, as I cannot reproduce the problem.
Regards, r.
It has been solved, see http://thread.gmane.org/gmane.comp.python.enthought.devel/32327 .
On 02/14/2014 09:10 PM, Jagannathan Tiruvallur Eachambadi wrote:
It has been solved, see http://thread.gmane.org/gmane.comp.python.enthought.devel/32327 .
Glad to hear that! r.
participants (2)
-
Jagannathan Tiruvallur Eachambadi
-
Robert Cimrman