[vtkusers] ImportError: No module named vtkCommonCorePython

DVigneault davis.vigneault at gmail.com
Tue Feb 24 05:11:13 EST 2015


All--

I'm getting the following error (copied below) when attempting to import vtk
in a python script.

Traceback (most recent call last):
  File "doosabin/visualise_subdivision.py", line 16, in <module> from
rscommon import vtk_
  File "/usr/local/lib/python2.7/dist-packages/rscommon/vtk_.py", line 13,
in <module> import vtk
  File "/home/davis/Developer/VTK/bin/Wrapping/Python/vtk/__init__.py", line
39, in <module> from vtkCommonCore import *
  File "/home/davis/Developer/VTK/bin/Wrapping/Python/vtk/vtkCommonCore.py",
line 1, in <module> from vtkCommonCorePython import *
ImportError: No module named vtkCommonCorePython

And it's true that there doesn't seem to be any file vtkCommonCorePython.py
(or with any other extension) in the Python/vtk/ directory.  I've built and
installed VTK with BUILD_SHARED_LIBS set to ON (I saw another thread [1]
where someone was getting the same error, but had built with shared libs
OFF) and VTK_WRAP_PYTHON set to ON.  Initially I got an error 'no module
named vtk,' which lead me to the page on python environment setup [2].  Not
all of the directories listed on that page existed (usr/local/bin contains a
vtkWrapPython-6.2 executable, but no VTK folder), so I instead added links
to my build tree (rather than my install tree).  $PYTHONPATH and
$LD_LIBRARY_PATH are as follows:

$ echo $PYTHONPATH
:/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/

echo $LD_LIBRARY_PATH
/usr/local/lib/:/home/davis/Developer/VTK/bin

I'm building 6.2 on Ubuntu 12.04, in case that gives any clues.  Thanks in
advance for your help!

Best,

--Davis

[1]
http://vtk.1045678.n5.nabble.com/vtkCommonCorePython-static-build-failure-td5714290.html
http://www.vtk.org/Wiki/VTK/Tutorials/PythonEnvironmentSetup



--
View this message in context: http://vtk.1045678.n5.nabble.com/ImportError-No-module-named-vtkCommonCorePython-tp5730504.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list