[Paraview] python scripts

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Sep 24 13:06:00 EDT 2008


That's weird.
from paraview import servermanager
should work from all the 3 locations client, pvbatch or pvpython.

Can you try the following script and print your path in all the three 
applications?

import sys
print sys.path

Utkarsh

Patrick Shinpaugh wrote:
> Hi,
> I've been writing some python scripts and running them through the 
> paraview GUI. I start the scripts with
> 
>    from paraview import servermanager
> 
> When I use pvpython or pvbatch to run the same scripts I receive an error:
> 
> [project] pvpython paraview.py
> Traceback (most recent call last):
>  File "paraview.py", line 1, in <module>
>    from paraview import servermanager
>  File "/home/project/paraview.py", line 1, in <module>
>    from paraview import servermanager
> ImportError: cannot import name servermanager
> 
> 
> After messing with this for a while I finally tried:
> 
>    import servermanager
> 
> which worked.
> 
> Question: Why is there a difference in the way the servermanager is 
> imported between paraview gui and pvpython/pvbatch? Have other people 
> run across this issue? This is version 3.2.2. Is it possible there is 
> something wrong my build? If this is something I just have to live with, 
> is there a way to prevent the error from closing the script/interpreter, 
> check to see if the first import failed and then run the second import?
> 
> Thanks,
> Pat
> 


More information about the ParaView mailing list