[Paraview] python scripting

Pat Marion pat.marion at kitware.com
Mon Mar 18 04:09:06 EDT 2013


Please copy the paraview at paraview.org mailing list when you reply.

Are you using python2.5 to run you script?  Does your version of OSX have
python2.6 or python2.7 (in /usr/bin) ?  On my machine, the system version
of numpy for pthon2.5 is only available in i386, while later versions
contains i383 and x86_64 architectures.  ParaView will require the x86_64
arch.  Can you use python2.6 to run the script?  Otherwise, you'll have to
install a newer python and numpy.

Pat

On Mon, Mar 18, 2013 at 5:57 PM, Chukwudi Chukwudozie <
cchukw1 at tigers.lsu.edu> wrote:

> Thanks for the reply. I think you are right. However, is there a reason
> why I cannot run a simple plot script using pvpython? I get the error below
> when I try to.
>
> Traceback (most recent call last):
>   File "plot.py", line 2, in <module>
>     import numpy as np
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/__init__.py",
> line 130, in <module>
>     import add_newdocs
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/add_newdocs.py",
> line 9, in <module>
>     from lib import add_newdoc
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/lib/__init__.py",
> line 152, in <module>
>     from type_check import *
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/lib/type_check.py",
> line 8, in <module>
>     import numpy.core.numeric as _nx
>   File
> "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/core/__init__.py",
> line 5, in <module>
>     import multiarray
> ImportError:
> dlopen(/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/core/multiarray.so,
> 2): no suitable image found.  Did find:
> /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/core/multiarray.so:
> mach-o, but wrong architecture
>
>
> On Mon, Mar 18, 2013 at 2:54 AM, Pat Marion <pat.marion at kitware.com>wrote:
>
>> For the script you downloaded, you should remove line 3 where it says
>> Connect().  It's possible the script is old enough that some of the
>> statements need to be updated in order to run against the latest version of
>> ParaView.
>>
>> Pat
>>
>>
>> On Mon, Mar 18, 2013 at 5:38 PM, Chukwudi Chukwudozie <
>> cchukw1 at tigers.lsu.edu> wrote:
>>
>>> The options you suggested seemed not to work. I also forgot to mention
>>> that I am not able to run a simple plot script using pvpython.
>>>
>>>
>>> On Sun, Mar 17, 2013 at 6:43 PM, Pat Marion <pat.marion at kitware.com>wrote:
>>>
>>>> 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
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> 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
>>>
>>
>>
>
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130318/c4d5c062/attachment-0001.htm>


More information about the ParaView mailing list