[Paraview] PYTHONPATH for prebuilt MAC OSX Paraview
Colin McAuliffe
cjm2176 at columbia.edu
Sat Oct 22 09:40:52 EDT 2011
I tried building from source but I am getting errors importing
paraview.simple:
>>> from paraview.simple import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Users/Christina/Desktop/Colin/Work/Paraview/ParaView-bin/Utilities/VTKPythonWrapping/site-packages/paraview/simple.py", line 39, in
<module>
import servermanager
File
"/Users/Christina/Desktop/Colin/Work/Paraview/ParaView-bin/Utilities/VTKPythonWrapping/site-packages/paraview/servermanager.py", line 43, in
<module>
import paraview, re, os, os.path, new, sys, vtk
File
"/Users/Christina/Desktop/Colin/Work/Paraview/ParaView-bin/Utilities/VTKPythonWrapping/site-packages/paraview/vtk/__init__.py", line 1, in
<module>
from vtkCommonPython import *
ImportError:
dlopen(/Users/Christina/Desktop/Colin/Work/Paraview/ParaView-bin/bin/vtkCommonPython.so, 2): no suitable image found. Did
find:
/Users/Christina/Desktop/Colin/Work/Paraview/ParaView-bin/bin/vtkCommonPython.so: mach-o, but wrong
architecture
So I guess I configured wrong? I set the following variables in cmake:
PARAVIEW_ENABLE_PYTHON ON
CMAKE_OSX_DEPLOYMENT_TARGET 10.6
CMAKE_CXX_FLAGS -arch x86_64
CMAKE_C_FLAGS -arch x86_64
CMAKE_OSX_ARCHITECTURES x86_64
Am I missing something?
Thanks
Colin
Quoting David E DeMarle <dave.demarle at kitware.com>:
> It shouldn't be a problem with a build from source version of
> ParaView. In that case when you turn on the python option cmake finds
> your system python libs and build/links with them. If they happen to
> find the wrong set for some reason you can always change them and
> rebuild.
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
>
> On Wed, Oct 19, 2011 at 5:40 PM, Colin McAuliffe
> <cjm2176 at columbia.edu> wrote:
>> Thanks, pvpython works. Are compatibility issues with paraview python
>> modules and mac system python also present for versions of paraview compiled
>> from the source code?
>>
>> Thanks
>> Colin
>>
>> Quoting pat marion <pat.marion at kitware.com>:
>>
>>> The 'paraview' directory is the module. Python treats directories that
>>> contain a __init__.py file as modules. So you want your python path to
>>> contain "/Applications/ParaView 3.10.1.app/Contents/Python", and drop the
>>> /paraview ending.
>>>
>>> But, I recommend you use pvpython instead of python. The paraview python
>>> modules may not be compatible with your system python. Using pvpython
>>> also
>>> ensures that all paths are set correctly, so you don't need to set
>>> PYTHONPATH. You can find pvpython at:
>>>
>>> /Applications/ParaView\ 3.10.1.app/Contents/bin/pvpython
>>>
>>> If you want to try system python, you need to:
>>>
>>> export PYTHONPATH=/Applications/ParaView\
>>> 3.10.1.app/Contents/Python:/Applications/ParaView\
>>> 3.10.1.app/Contents/Libraries
>>> export DYLD_LIBRARY_PATH=/Applications/ParaView\
>>> 3.10.1.app/Contents/Libraries
>>>
>>> I'm not sure it will work for you though. On my system, python aborts
>>> when
>>> the modules are loaded.
>>>
>>> Pat
>>>
>>> On Fri, Sep 30, 2011 at 11:51 AM, Colin McAuliffe
>>> <cjm2176 at columbia.edu>wrote:
>>>
>>>> Hello all,
>>>>
>>>> As I understand it, to take advantage of python scripting the PYTHONPATH
>>>> variable must be set manually. I have added:
>>>>
>>>> PYTHONPATH="/Applications/**ParaView 3.10.1.app/Contents/Python/**
>>>> paraview:${PYTHONPATH}"
>>>> export PYTHONPATH
>>>>
>>>> Which is the location of .py modules. I am not able to locate the module
>>>> paraview however. Where would this module be located?
>>>>
>>>> Thanks
>>>>
>>>> --
>>>> Colin McAuliffe
>>>> PhD Candidate
>>>> Columbia University
>>>> Department of Civil Engineering and Engineering Mechanics
>>>> ______________________________**_________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at http://www.kitware.com/**
>>>>
>>>> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>>>>
>>>> Please keep messages on-topic and check the ParaView Wiki at:
>>>> http://paraview.org/Wiki/**ParaView <http://paraview.org/Wiki/ParaView>
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>>
>>>> http://www.paraview.org/**mailman/listinfo/paraview<http://www.paraview.org/mailman/listinfo/paraview>
>>>>
>>>
>>
>>
>>
>> --
>> Colin McAuliffe
>> PhD Candidate
>> Columbia University
>> Department of Civil Engineering and Engineering Mechanics
>> _______________________________________________
>> 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
>>
>
>
--
Colin McAuliffe
PhD Candidate
Columbia University
Department of Civil Engineering and Engineering Mechanics
More information about the ParaView
mailing list