[Paraview] python scripting

Pat Marion pat.marion at kitware.com
Sun Mar 17 19:43:36 EDT 2013


For PYTHONPATH, try removing the last /paraview components from the path,
so you're setting:   /Applications/ParaView.app/Contents/Python

Also add /Applications/ParaView.app/Contents/Libraries to PYTHONPATH and
DYLD_LIBRARY_PATH.  Note, that is DYLD not LD.  You don't need to add the
Contents/bin directory to DYLD_LIBRARY_PATH, and you don't need to add
DYLD_LIBRARY_PATH to PATH, and you don't need to add PYTHONPATH to PATH.


In summary, ParaView uses both pure python modules and c extension
modules.  The pure python modules are in Contents/Python, and the c
extension modules are in Contents/Libraries.  Both these paths should be on
PYTHONPATH (or append sys.path at the top of your main script).  The c
extenion modules have dependencies on dynamic libraries which are located
in Contents/Libraries, so Contents/Libraries this needs to be in the
DYLD_LIBRARY_PATH.

Pat


On Sat, Mar 16, 2013 at 12:58 PM, Chukwudi Chukwudozie <
cchukw1 at tigers.lsu.edu> wrote:

> Hi,
>
> I want help to be able to do the following two things using my mac OS X
> 10.7.5 but I have not been successful.
>
> 1. Run a paraview python script on terminal using pvpython.
> 2. Run the same script on terminal using python.
>
> For (1) above, I saved the trace for a particular operation and ran it
> using pvpython and it worked. However, I got a paraview python scripts
> (newscript.py) on the internet and when I try to run them on my terminal
> using pvpython, it aborts with the error below.
>
> Traceback (most recent call last):
>   File "newscript.py", line 3, in <module>
>     Connect()
>   File
> "/Applications/ParaView.app/Contents/Python/paraview/servermanager.py",
> line 1932, in Connect
>     connection = Connection(id, session)
>   File
> "/Applications/ParaView.app/Contents/Python/paraview/servermanager.py",
> line 1806, in __init__
>     raise RuntimeError, "Concurrent connections not supported!"
> RuntimeError: Concurrent connections not supported!
>
>
> For (2) above, I tried to run on my terminal using system python, the
> saved trace (newparaview.py) that was successful with pvpython and it keeps
> aborting with the following error messages
>
> Traceback (most recent call last):
>   File "newparaview.py", line 2, in <module>
>     from paraview.servermanager import *
> ImportError: No module named paraview.servermanager
>
> My .bash_profile file looks like this.
>
> export LD_LIBRARY_PATH=/Applications/ParaView.app/Contents/bin
> export PATH=$PATH:${LD_LIBRARY_PATH}
>
> export
> PYTHONPATH=$PYTHONPATH:/Applications/ParaView.app/Contents/Python/paraview:/Applications/ParaView.app/Contents/bin
> export PATH=$PATH:{$PYTHONPATH}
>
> # Setting PATH for EPD_free-7.2-2
> # The orginal version is saved in .bash_profile.pysave
> PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
> export PATH
>
>
> Regards,
>
>
> --
> Chukwudi Chukwudozie
> cchukw1 at tigers.lsu.edu
> Craft and Hawkins Department of Petroleum Engineering
> Louisiana State University
> Patrick F. Taylor Hall (CEBA)
> Room 3429
> Baton Rouge LA, 70803
> Cell:3373546822
> Office: 2255786064
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130318/98faedc4/attachment.htm>


More information about the ParaView mailing list