[Paraview] python scripts

Patrick Shinpaugh shpatric at vt.edu
Wed Sep 24 12:08:03 EDT 2008


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

-- 
Patrick Shinpaugh
Virginia Tech
UVAG System Administrator/Programmer
540-231-2054



More information about the ParaView mailing list