HAVING TROUBLE RUNNING TESTS AND EXAMPLES

426 views
Skip to first unread message

Abba Abubakar

unread,
Jul 17, 2016, 8:25:15 PM7/17/16
to pysph-users
Hi,

I am a new user of pysph, I have followed the procedure given in pysph for the installation of the packages. However, when I use the $ pysph run elliptical_drop  to run the example, the python program does not recognize it. 

>>> pysph run elliptical_drop
  File "<stdin>", line 1
    pysph run elliptical_drop
            ^
SyntaxError: invalid syntax
>>> 

When I open the program and run the file directly, it runs correctly. But it does not display the results in Mayavi, it only shows the final plot of p vs t.png.

I am new to python as well. I am using VS 2013 with canopy on windows 8.1. Please, I seek your assistance on this in order to work on my thesis. You can send me any video tutorial, pdf file, internet site which will help me to be familiarized with installing and running pysph in windows.

Thanks
Abba

Siddharth Siddhu

unread,
May 18, 2017, 2:08:03 AM5/18/17
to pysph-users
Hello PySPH user,

I am new to PySPH and i have been experimenting on the framework since a month. I have followed the procedures for installation and everything works fine except when it comes to opening the results in mayavi.
y name is B.Siddharth and I am in doing my masters in University of British Columbia.


For running the test cases, i was following the literature given in your website (https://pythonhosted.org/PySPH/installation.html) and i am facing a small problem.

Firstly when i type
$ pysph run ,
it shows all the 35 test cases that are provided in the PySPH module. Then, i try to run the cavity test case, the test runs fine and i get the setup time and run time.

After the successful run of the test case, the file cavity_output file is generated. Now i try to visualize the output by using the required command as given in the website.
$ pysph view cavity_output ,
i got  an error called segmentation fault and i don't see the PySPH particle viewer screen opening.

I have research for the solutions for the error and asked pysph users and i tried the following commands to fix the problem. I was told by the solutions and users that the problem is with ubuntu 16.04 where the VTK version is linked to Qt5 but mayaviuses Qt4.

sudo apt-get remove mayavi2 python-vtk6
sudo apt-get install python-vtk

Then, installing mayavi in the virtual env,

pip install mayavi

I was hoping that the problem of pysph particle viwer will be fixed but now i am getting the following error.

Traceback (most recent call last):
  File "/home/siddy/.local/bin/pysph", line 11, in <module>
    load_entry_point('PySPH==1.0a4', 'console_scripts', 'pysph')()
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 70, in main
    args.func(extra)
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 11, in run_viewer
    from pysph.tools.mayavi_viewer import main
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/mayavi_viewer.py", line 37, in <module>
    from enthought.traits.api import (Any, Array, Dict, HasTraits,
ImportError: No module named enthought.traits.api

How do i solve this problem? It looks to me like the dependencies for mayavi are not installed but when i run the pip install command for mayavi installation to check if mayavi is installed, i get the following;

(pysph_env) siddy@siddy-VirtualBox:~$ pip install mayavi
Requirement already satisfied: mayavi in ./pysph_env/lib/python2.7/site-packages
Requirement already satisfied: traits in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: apptools in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: traitsui in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: configobj in /usr/lib/python2.7/dist-packages (from apptools->mayavi)
Requirement already satisfied: pyface in ./pysph_env/lib/python2.7/site-packages (from traitsui->mayavi)
Requirement already satisfied: six in ./pysph_env/lib/python2.7/site-packages (from configobj->apptools->mayavi)
Requirement already satisfied: pygments in ./pysph_env/lib/python2.7/site-packages (from pyface->traitsui->mayavi)

Can someone please suggest me on how to tackle this problem?

Thank you.

Prabhu Ramachandran

unread,
May 18, 2017, 10:26:46 PM5/18/17
to Siddharth Siddhu, pysph-users
Hi Siddharth,

On Friday 19 May 2017 02:34 AM, Siddharth Siddhu wrote:
The test cases run fine. I get these errors only i try to run pysph view command.

I tried running the command you sent me with the virtualenv activated. I got the following error.

$ python mayavi_viewer.py

********************************************************************************
WARNING: Imported VTK version (5.1) does not match the one used
         to build the TVTK classes (6.2). This may cause problems.
         Please rebuild TVTK.
********************************************************************************
[...]
This basically says that mayavi which i tried to installed supports vtk5.1 but the previous installed TVTK version is 6.2.

Should i try the commands you sent me in your previous email? Or will reinstallling pysph in ubuntu 14.04 instead of 16.04 solve all the problems?

No you don't need that.  What seems to have happened is that you have installed mayavi the first time also in your virtualenv so it is still using that.  Just do the following:

$ pip uninstall mayavi
$ pip install mayavi

Then try again and it should work.  I'll fix the view command to not give the strange error it was giving earlier soon.

cheers,
Prabhu

Siddharth Siddhu

unread,
May 19, 2017, 1:07:23 AM5/19/17
to pysph-users, siddharth...@gmail.com, pra...@aero.iitb.ac.in
Hello professor,

i tried to uninstall mayavi and reinstalling mayavi with the two commands you suggested.


(pysph_env) siddy@siddy-VirtualBox:~$ pip install mayavi

Collecting mayavi

Requirement already satisfied: traits in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: apptools in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: traitsui in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: configobj in ./pysph_env/lib/python2.7/site-packages (from apptools->mayavi)

Requirement already satisfied: pyface in ./pysph_env/lib/python2.7/site-packages (from traitsui->mayavi)
Requirement already satisfied: six in ./pysph_env/lib/python2.7/site-packages (from configobj->apptools->mayavi)
Requirement already satisfied: pygments in ./pysph_env/lib/python2.7/site-packages (from pyface->traitsui->mayavi)
Installing collected packages: mayavi
Successfully installed mayavi-4.5.0

However still i still get the following warning.

(pysph_env) siddy@siddy-VirtualBox:~$ python mayavi_viewer.py
********************************************************************************
WARNING: Imported VTK version (5.1) does not match the one used
         to build the TVTK classes (6.2). This may cause problems.
         Please rebuild TVTK.
********************************************************************************

Traceback (most recent call last):
  File "mayavi_viewer.py", line 1128, in <module>
    main()
  File "mayavi_viewer.py", line 1124, in main
    m.configure_traits()
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traits/has_traits.py", line 2172, in configure_traits
    kind, handler, id, scrollable, args )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/toolkit.py", line 213, in view_application
    id, scrollable, args )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/view_application.py", line 83, in view_application
    scrollable, args ).ui.result
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/view_application.py", line 134, in __init__
    args       = self.args )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/view.py", line 433, in ui
    ui.ui( parent, kind )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/ui.py", line 221, in ui
    self.rebuild( self, parent )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/toolkit.py", line 155, in ui_live
    ui_live.ui_live( ui, parent )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_live.py", line 39, in ui_live
    _ui_dialog(ui, parent, BaseDialog.NONMODAL)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_live.py", line 59, in _ui_dialog
    BaseDialog.display_ui(ui, parent, style)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_base.py", line 482, in display_ui
    ui.owner.init(ui, parent, style)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_live.py", line 177, in init
    self.add_contents(panel(ui), bbox)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_panel.py", line 255, in panel
    panel = _GroupPanel(content[0], ui).control
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_panel.py", line 545, in __init__
    self._add_splitter_items(content, splitter)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_panel.py", line 623, in _add_splitter_items
    panel = _GroupPanel(item, self.ui, suppress_label=True).control
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_panel.py", line 592, in __init__
    layout = self._add_items(content, inner)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/qt4/ui_panel.py", line 860, in _add_items
    editor.prepare(inner)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traitsui/editor.py", line 156, in prepare
    self.init( parent )
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/tvtk/pyface/ui/qt4/scene_editor.py", line 49, in init
    self._create_scene()
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/tvtk/pyface/ui/qt4/scene_editor.py", line 88, in _create_scene
    self._scene = factory.scene_class(self.control)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/tvtk/pyface/ui/qt4/decorated_scene.py", line 59, in __init__
    super(DecoratedScene, self).__init__(parent, **traits)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/tvtk/pyface/ui/qt4/scene.py", line 325, in __init__
    self.picker = picker.Picker(self)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/tvtk/pyface/picker.py", line 260, in __init__
    configure_input(self.p_mapper, self.p_source)
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/tvtk/common.py", line 88, in configure_input
    inp.input = op.output
  File "/home/siddy/pysph_env/local/lib/python2.7/site-packages/traits/trait_handlers.py", line 104, in _read_only
    name, class_of( object ) )
traits.trait_errors.TraitError: The 'input' trait of a PolyDataMapper instance is 'read only'.

And, running the pysph view command results in the same previous error.
 
(pysph_env) siddy@siddy-VirtualBox:~$ pysph view shocktube_output

Traceback (most recent call last):
  File "/home/siddy/.local/bin/pysph", line 11, in <module>
    load_entry_point('PySPH==1.0a4', 'console_scripts', 'pysph')()
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 70, in main
    args.func(extra)
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 11, in run_viewer
    from pysph.tools.mayavi_viewer import main
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/mayavi_viewer.py", line 22, in <module>
    from enthought.etsconfig.api import ETSConfig
ImportError: No module named enthought.etsconfig.api

I tried to follow your previous commands regarding vtk which you have given me in your previous emails but it does not have any effect on the output of the command, python mayavi_viewer.py

sudo apt-get remove mayavi2 python-vtk6
sudo apt-get install python-vtk

I don't understand the source of the problem.

Siddharth

Prabhu Ramachandran

unread,
May 19, 2017, 1:51:11 AM5/19/17
to pysph...@googlegroups.com
On Friday 19 May 2017 10:37 AM, Siddharth Siddhu wrote:
i tried to uninstall mayavi and reinstalling mayavi with the two commands you suggested.

(pysph_env) siddy@siddy-VirtualBox:~$ pip install mayavi

Collecting mayavi
Requirement already satisfied: traits in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: apptools in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: traitsui in ./pysph_env/lib/python2.7/site-packages (from mayavi)
Requirement already satisfied: configobj in ./pysph_env/lib/python2.7/site-packages (from apptools->mayavi)
Requirement already satisfied: pyface in ./pysph_env/lib/python2.7/site-packages (from traitsui->mayavi)
Requirement already satisfied: six in ./pysph_env/lib/python2.7/site-packages (from configobj->apptools->mayavi)
Requirement already satisfied: pygments in ./pysph_env/lib/python2.7/site-packages (from pyface->traitsui->mayavi)
Installing collected packages: mayavi
Successfully installed mayavi-4.5.0

However still i still get the following warning.

(pysph_env) siddy@siddy-VirtualBox:~$ python mayavi_viewer.py
********************************************************************************
WARNING: Imported VTK version (5.1) does not match the one used
         to build the TVTK classes (6.2). This may cause problems.
         Please rebuild TVTK.
********************************************************************************

So it is possible pip is caching the previous build, what a pain!  So try this please:

pip uninstall mayavi
pip --no-cache-dir install mayavi



And, running the pysph view command results in the same previous error.
Yes, because the problem isn't fixed.


 
I tried to follow your previous commands regarding vtk which you have given me in your previous emails but it does not have any effect on the output of the command, python mayavi_viewer.py

Because pip has very helpfully cached the previous build, causing these headaches.  Let us hope this time it actually fixes this.  The trouble is a combination of bugs, one with the debian mayavi package, the second with pip's cache..

This is one reason why using edm or conda is probably simpler but alas it is another set of tools and options and potentially new issues.  So for now lets try this.

cheers,
Prabhu


Siddharth Siddhu

unread,
May 19, 2017, 4:08:24 AM5/19/17
to pysph-users, pra...@aero.iitb.ac.in
Dear professor,

Thank you for your solution.

I can successfully run the following command.

$ python mayavi_viewer.py

When i run the above command, the PySPH Particle viewer opens. Please find the attachment showing the command the PySPH particle viewer.

Thank you for the help.

However when i run the pysph view command,

$ (pysph_env) siddy@siddy-VirtualBox:~$ pysph view blastwave_output/

Traceback (most recent call last):
  File "/home/siddy/.local/bin/pysph", line 11, in <module>
    load_entry_point('PySPH==1.0a4', 'console_scripts', 'pysph')()
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 70, in main
    args.func(extra)
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 11, in run_viewer
    from pysph.tools.mayavi_viewer import main
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/mayavi_viewer.py", line 22, in <module>
    from enthought.etsconfig.api import ETSConfig
ImportError: No module named enthought.etsconfig.api

I am trying to figure out what error means.

Thank you.
Siddharth
pysph_particleviewer.png

Prabhu Ramachandran

unread,
May 19, 2017, 10:18:15 AM5/19/17
to pysph...@googlegroups.com
Hi,


On Friday 19 May 2017 01:38 PM, Siddharth Siddhu wrote:

However when i run the pysph view command,

$ (pysph_env) siddy@siddy-VirtualBox:~$ pysph view blastwave_output/
Traceback (most recent call last):
  File "/home/siddy/.local/bin/pysph", line 11, in <module>
    load_entry_point('PySPH==1.0a4', 'console_scripts', 'pysph')()
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 70, in main
    args.func(extra)
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/cli.py", line 11, in run_viewer
    from pysph.tools.mayavi_viewer import main
  File "/home/siddy/.local/lib/python2.7/site-packages/pysph/tools/mayavi_viewer.py", line 22, in <module>
    from enthought.etsconfig.api import ETSConfig
ImportError: No module named enthought.etsconfig.api

I am trying to figure out what error means.

Seems like this is a different installation of pysph in your path -- notice that this is in .local/lib and not in your pysph_env.  Did you run

pip install pysph --user 

at some point?  You should remove the ~/.local/bin/pysph that you seem to have installed.


Regards,
Prabhu

Siddharth Siddhu

unread,
May 19, 2017, 3:06:27 PM5/19/17
to pysph-users, pra...@aero.iitb.ac.in
Hello Professor,

I uninstalled the pysph, removed the package which was installed in .local/lib directory and reinstalled pysph in the virualenv of pysph.

Now the view command works perfectly fine. I am able to see all the results i have generated from the test cases like rings collosion, dam break, cavity etc.

Thanks a lot professor for helping me figure out the problem. Really appreciate the help.

Yours sincerely,
B.Siddharth
pysph view command_working.png
Reply all
Reply to author
Forward
0 new messages