[Paraview] [EXTERNAL] Re: paraview.simple and generic python

Scott, W Alan wascott at sandia.gov
Fri Feb 7 20:48:24 EST 2014


Patrick,
I tried it before, and it failed.  I just tried it - and it worked!  I needed your hint - I was pointing to the install, rather than the build.

Thank you!

Alan

From: Patrick O'Leary [mailto:patrick.oleary at kitware.com]
Sent: Friday, February 07, 2014 6:34 PM
To: Scott, W Alan
Cc: paraview at paraview.org
Subject: [EXTERNAL] Re: [Paraview] paraview.simple and generic python

Dear Alan,
Sebastien recently posted this:

import sys
pv_path = '/Users/seb/work/code/ParaView/build-ninja'
sys.path.append('%s/lib' % pv_path)
sys.path.append('%s/lib/site-packages' % pv_path)

from paraview.simple import *

Where pv_path is the path to the ParaView build. This seems to work well for me. Can you give it a try?
Best regards,
Patrick

On Fri, Feb 7, 2014 at 6:24 PM, Scott, W Alan <wascott at sandia.gov<mailto:wascott at sandia.gov>> wrote:
I have a user that wants to use ParaView from within generic python (not pvpython).  Unfortunately, I am somewhat struggling.  Does anyone have any ideas?

I am running the version of Python that was used to build ParaView (i.e., probably no version mismatch).

setenv LD_LIBRARY_PATH  .../Python-2.7.5/lib/
setenv PYTHONPATH  ....paraview-install/lib/paraview-4.1/site-packages

..../Python-2.7.5/bin/python

Python 2.7.5 (default, Jun 17 2013, 15:20:04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> from paraview.simple import *
Error: Could not import vtkCommonComputationalGeometryPython
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "..../lib/paraview-4.1/site-packages/paraview/simple.py", line 41, in <module>
    import servermanager
  File "..../lib/paraview-4.1/site-packages/paraview/servermanager.py", line 48, in <module>
    import paraview, re, os, os.path, new, sys, atexit, vtk
  File "..../lib/paraview-4.1/site-packages/paraview/vtk/__init__.py", line 7, in <module>
    from vtkCommonCorePython import *
ImportError: No module named vtkCommonCorePython
>>>

So, my question is, where does vtkCommonCorePython come from?  There isn't a vtkCommonCorePython.py in the tree, but is a ..../lib/paraview-4.1/site-packages/vtk/vtkCommonCorePython.so.  How does this get linked in?

Thanks,

Alan Scott




_______________________________________________
Powered by www.kitware.com<http://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/20140208/b10b14db/attachment.html>


More information about the ParaView mailing list