<div dir="ltr">Hi Davis,<div><br></div><div>It is looking for vtkCommonCorePython.so in the lib directory. Use this, if your VTK build is in /home/davis/Developer/VTK/bin:</div><div><br></div><div>PYTHONPATH=/home/davis/Developer/VTK/bin/Wrapping/Python/:/home/davis/Developer/VTK/bin/lib<div class="gmail_extra"><br></div><div class="gmail_extra">LD_LIBRARY_PATH=/home/davis/Developer/VTK/bin/lib<br><div class="gmail_quote"><br></div><div class="gmail_quote">You can also try running the vtkpython executable, which has these paths baked-in.</div><div class="gmail_quote"><br></div><div class="gmail_quote"> - David</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Feb 24, 2015 at 3:11 AM, DVigneault <span dir="ltr"><<a href="mailto:davis.vigneault@gmail.com" target="_blank">davis.vigneault@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">All--<br>
<br>
I'm getting the following error (copied below) when attempting to import vtk<br>
in a python script.<br>
<br>
Traceback (most recent call last):<br>
  File "doosabin/visualise_subdivision.py", line 16, in <module> from<br>
rscommon import vtk_<br>
  File "/usr/local/lib/python2.7/dist-packages/rscommon/vtk_.py", line 13,<br>
in <module> import vtk<br>
  File "/home/davis/Developer/VTK/bin/Wrapping/Python/vtk/__init__.py", line<br>
39, in <module> from vtkCommonCore import *<br>
  File "/home/davis/Developer/VTK/bin/Wrapping/Python/vtk/vtkCommonCore.py",<br>
line 1, in <module> from vtkCommonCorePython import *<br>
ImportError: No module named vtkCommonCorePython<br>
<br>
And it's true that there doesn't seem to be any file vtkCommonCorePython.py<br>
(or with any other extension) in the Python/vtk/ directory.  I've built and<br>
installed VTK with BUILD_SHARED_LIBS set to ON (I saw another thread [1]<br>
where someone was getting the same error, but had built with shared libs<br>
OFF) and VTK_WRAP_PYTHON set to ON.  Initially I got an error 'no module<br>
named vtk,' which lead me to the page on python environment setup [2].  Not<br>
all of the directories listed on that page existed (usr/local/bin contains a<br>
vtkWrapPython-6.2 executable, but no VTK folder), so I instead added links<br>
to my build tree (rather than my install tree).  $PYTHONPATH and<br>
$LD_LIBRARY_PATH are as follows:<br>
<br>
$ echo $PYTHONPATH<br>
:/home/davis/Developer/VTK/bin/:/home/davis/Developer/VTK/bin/Wrapping/Python/:/home/davis/Developer/VTK/bin/Wrapping/Python/vtk/:/home/davis/Developer/VTK/bin/Wrapping/PythonCore/:/usr/local/bin/:/usr/local/bin/include/<br>
<br>
echo $LD_LIBRARY_PATH<br>
/usr/local/lib/:/home/davis/Developer/VTK/bin<br>
<br>
I'm building 6.2 on Ubuntu 12.04, in case that gives any clues.  Thanks in<br>
advance for your help!<br>
<br>
Best,<br>
<br>
--Davis<br>
<br>
[1]<br>
<a href="http://vtk.1045678.n5.nabble.com/vtkCommonCorePython-static-build-failure-td5714290.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkCommonCorePython-static-build-failure-td5714290.html</a><br>
<a href="http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup" target="_blank">http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup</a><br></blockquote></div></div></div></div>