[vtkusers] VTK and Python on OS X El Capitan

David Gobbi david.gobbi at gmail.com
Tue Oct 6 11:31:43 EDT 2015


Hi Eric,

Thanks for the info.

Out of curiosity, what happens when you run programs with VTK's
own vtkpython executable?  I'm guessing that would work, since it
isn't a "restricted binary".

About the rpaths, I'm a little surprised they are still in the .so files,
because a "make install" should clear away the rpaths unless the
files are being installed into a bundle.

 - David


On Tue, Oct 6, 2015 at 5:53 AM, Eric Nodwell <eric.nodwell at numerics88.com>
wrote:

> For VTK 6.3.0 in OS X 10.11 El Capitan, if you are compiling VTK
> yourself, it is no longer possible to link against the system python.
> This is due to the new System Integrity Protection. The system python
> is a protected location in OS 10.11, and SIP is very strict about what
> can be linked, and how, to restricted programs. Although the build
> will succeed, this is what happens when you attempt to load VTK in
> python:
>
> $ python
>
> Python 2.7.10 (default, Aug 22 2015, 20:33:39)
> [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import vtk
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/Users/Shared/install/vtk-6.3.0/lib/python2.7/site-packages/vtk/__init__.py",
> line 39, in <module>
>     from vtkCommonCore import *
>   File
> "/Users/Shared/install/vtk-6.3.0/lib/python2.7/site-packages/vtk/vtkCommonCore.py",
> line 1, in <module>
>     from vtkCommonCorePython import *
> ImportError:
> dlopen(/Users/Shared/install/vtk-6.3.0/lib/python2.7/site-packages/vtk/vtkCommonCorePython.so,
> 2): Library not loaded: libvtkCommonCorePython27D-6.3.1.dylib
>   Referenced from:
>
> /Users/Shared/install/vtk-6.3.0/lib/python2.7/site-packages/vtk/vtkCommonCorePython.so
>   Reason: unsafe use of relative rpath
> libvtkCommonCorePython27D-6.3.1.dylib in
>
> /Users/Shared/install/vtk-6.3.0/lib/python2.7/site-packages/vtk/vtkCommonCorePython.so
> with restricted binary
>
> The easiest solution is to use python from python.org . For those
> unsure, here are the relevant CMake variables to build VTK against the
> python.org python (if multiple pythons are installed, CMake tends to
> find the system python libraries):
>
> PYTHON_EXECUTABLE
> /Library/Frameworks/Python.framework/Versions/2.7/bin/python
> PYTHON_INCLUDE_DIR
> /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
> PYTHON_LIBRARY
> /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
>
> Eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151006/6869d8cf/attachment.html>


More information about the vtkusers mailing list