[Paraview] pvpython and f2py

Peter Brady petertbrady at gmail.com
Mon Mar 15 19:17:54 EDT 2010


Eric,

That seems to do the trick.

Thanks,

Peter.

On Mon, Mar 15, 2010 at 3:55 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:

> Hey Peter,
>
> Maybe the problem is that the PYTHONPATH that the programmable filter knows
> doesn't contain your module?
>
> Try adding at the beginning of your Programmable Filter:
>
> import sys
> sys.path.append('/Dir/of/your/library')
>
> so it can see things in your library directory and see if your import
> statement works after that.
>
> I don't know the "real" way, offhand, to include new directories in the
> PYTHONPATH of the programmable filter (i.e. I don't know if the PYTHONPATH
> environment variable affects the PPF).
>
> -Eric
>
>
> On Mar 15, 2010, at 6:41 PM, Peter Brady wrote:
>
> Hi Eric,
>
> I'm use Fedora 11 64-bit.  I tried a few more things so maybe this will
> help.  Using f2py gives me a .so file (streamfunc.so) which I can then
> import in a pvpython script using:
>
> import streamfunc
>
> My problem is that I have a programmable filter which needs this module but
> when I import it in my programmable filter script I get the error:
>
> ImportError: No module named streamfunc
>
> So it seems the problem is with the programmable filter and not with
> pvpython itself.
>
>
> On Mon, Mar 15, 2010 at 3:28 PM, Eric E. Monson <emonson at cs.duke.edu>wrote:
>
>> Hey Peter,
>>
>> What platform are you using and how are you trying to import the .so file?
>> On my Mac, any of the VTK libraries (my own or original VTK) which are
>> wrapped in Python end up as .so files, and they load just fine. What is
>> python saying when it "doesn't seem to recognize" them?
>>
>> Talk to you later,
>> -Eric
>>
>>
>> On Mar 15, 2010, at 5:44 PM, Peter Brady wrote:
>>
>> > Hello all,
>> >
>> > I need to perform some computations on my data and for speed reasons I
>> would like to use fortran to accomplish this.  Using pvpython I can get the
>> data I need, and using f2py I can wrap my fortran subroutine but I can only
>> get f2py to create a .so file which pvpython doesn't seem to recognize when
>> I try to import it as a module.  Can someone tell me how to either:
>> >
>> > 1.  Get pvpython to recognize the .so file created by f2py or
>> >
>> > 2.  Use f2py to generate a .py file instead of a .so file
>> >
>> > Thanks in advance,
>> >
>> > Peter.
>> > _______________________________________________
>> > 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/20100315/cdbd4789/attachment-0001.htm>


More information about the ParaView mailing list