[vtkusers] ImportError: No module named vtkCommonCorePython
David Gobbi
david.gobbi at gmail.com
Tue Feb 24 08:25:10 EST 2015
Hi Davis,
It is looking for vtkCommonCorePython.so in the lib directory. Use this, if
your VTK build is in /home/davis/Developer/VTK/bin:
PYTHONPATH=/home/davis/Developer/VTK/bin/Wrapping/Python/:/home/davis/Developer/VTK/bin/lib
LD_LIBRARY_PATH=/home/davis/Developer/VTK/bin/lib
You can also try running the vtkpython executable, which has these paths
baked-in.
- David
On Tue, Feb 24, 2015 at 3:11 AM, DVigneault <davis.vigneault at gmail.com>
wrote:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150224/0fc30a14/attachment.html>
More information about the vtkusers
mailing list