[Paraview] Python Error in Python Shell

Mike Jackson imikejackson at gmail.com
Wed Feb 27 17:53:34 EST 2008


What I have now (after some trial and error) the the following:

     const char* inst_dirs[] = {
       "/paraview",
#if defined(__APPLE__)
       "/../lib", // MacOS .app Package
#endif
       "/../lib/paraview-" PARAVIEW_VERSION "/paraview",
       "/../../lib/paraview-" PARAVIEW_VERSION "/paraview",
       "/lib/python" VTK_PYTHON_VERSION "/site-packages/paraview", //  
UNIX --prefix
       "/lib/python/paraview", // UNIX --home
       "/Lib/site-packages/paraview", "/Lib/paraview", // Windows
       "/site-packages/paraview", "/paraview", // Windows
       0
     };

and then a few lines after that:

#if defined(__APPLE__)
     vtkstd::string libDirPath = self_dir;
     libDirPath.append("/../lib");
     vtkPythonAppInitPrependPythonPath(libDirPath.c_str() );
#endif

And then I updated the scripts to copy the python modules into the  
lib directory inside the app package. I can now run python scripts  
seemingly without any errors now.

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Feb 27, 2008, at 4:55 PM, Berk Geveci wrote:

> I believe the code you are looking for is in
> /Utilities/VTKPythonWrapping/Executable/vtkPVPythonInterpretor.cxx
>
> Be very gentle with that code, it broke many many times :-)
>
> -berk
>
> On 2/27/08, Mike Jackson <imikejackson at gmail.com> wrote:
>> I have narrowed this down some more and the python loading mechanism
>>  looks for the *python.so files in the same directory as paraview.
>>  Within the App bundle the mechanism should probably be looking in  
>> lib
>>  or plugins instead. Anyone know which source file sets this  
>> search path?
>>
>>  thanks
>>
>> --
>>  Mike Jackson   Senior Research Engineer
>>
>>
>>
>>
>> On Feb 27, 2008, at 2:24 PM, Eric E. Monson wrote:
>>
>>
>>> Hey Mike,
>>>
>>> On my system both the libvtkCommonPython.so and
>>> libvtkCommonPythonD.dylib both end up in the build/bin directory,
>>> like any other plugin or library, in case that helps.
>>>
>>> -Eric
>>>
>>> ------------------------------------------------------
>>> Eric E Monson
>>> Duke Visualization Technology Group
>>>
>>>
>>>
>>> On Feb 27, 2008, at 2:11 PM, Mike Jackson wrote:
>>>
>>>> I found the "D" section of the Python cmake code and it seems to
>>>> be hard coded in there. So you are probably correct, it doesn't
>>>> stand for "Debug".
>>>>
>>>> I guess I need to track down where the libvtkCommonPython.so is
>>>> created to see if I can tie into that cmake code to create shell
>>>> scripts that will copy and update those as plugins. Any ideas
>>>> where those targets are created?
>>>>
>>>> --
>>>> Mike Jackson   Senior Research Engineer
>>>> Innovative Management & Technology Services
>>>>
>>>>
>>>> On Feb 27, 2008, at 2:01 PM, Berk Geveci wrote:
>>>>
>>>>> The .so is the plugin module. It links against the .dylib which  
>>>>> the
>>>>> plugin links against. You need both. I am not sure what the D  
>>>>> stands
>>>>> for but it is not debug. Dynamic maybe.
>>>>>
>>>>> On 2/27/08, Mike Jackson <imikejackson at gmail.com> wrote:
>>>>>> I am working on a new packaging shell script for OS X and I am
>>>>>> getting the following error when I attempt to run the Python  
>>>>>> Shell:
>>>>>>
>>>>>>
>>>>>> Python 2.3.5 (#1, Jan 13 2006, 20:13:11)
>>>>>> [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
>>>>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>   File "<string>", line 1, in ?
>>>>>>   File "/Users/Shared/Toolkits/ParaView3/bin/paraview.app/ 
>>>>>> Contents/
>>>>>> SharedSupport/paraview/__init__.py", line 40, in ?
>>>>>>     from libvtkPVServerCommonPython import *
>>>>>> ImportError: No module named libvtkPVServerCommonPython
>>>>>>>>>
>>>>>>
>>>>>> Taking a look around I see that ParaView is linked against
>>>>>> libvtkPVServerCommonPythonD.dylib. There is also a
>>>>>> libvtkPVServerCommonPython.so library. Is that a plugin that I am
>>>>>> missing maybe?
>>>>>>
>>>>>> Also, not sure of the naming convention, but I did a Release  
>>>>>> build
>>>>>> but I still have libvtkPVServerManagerPythonD,
>>>>>> libvtkPVServerCommonPythonD, libvtkCommonPythonD as dylibs. I  
>>>>>> would
>>>>>> think those names would be missing the "D" at the end of the  
>>>>>> name.
>>>>>>
>>>>>> Any help or insights would be greatly appreciated.
>>>>>>
>>>>>> --
>>>>>> Mike Jackson
>>>>>> imikejackson & gmail * com
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> ParaView mailing list
>>>>>> ParaView at paraview.org
>>>>>> http://www.paraview.org/mailman/listinfo/paraview
>>>>>>
>>>>
>>>> _______________________________________________
>>>> ParaView mailing list
>>>> ParaView at paraview.org
>>>> http://www.paraview.org/mailman/listinfo/paraview
>>>
>>
>>  _______________________________________________
>>  ParaView mailing list
>>  ParaView at paraview.org
>>  http://www.paraview.org/mailman/listinfo/paraview
>>



More information about the ParaView mailing list