

Library/Frameworks/amework/Versions/ 2.7/Python (compatibility version 2.7. Note that otool -L vtkCommonCorePython.so (for an example) will still write in the output, but the value still is fixed. Read here more about CMake's rpath handling. DPYTHON_LIBRARY= "/Library/Frameworks/amework/Versions/2.7/lib/libpython2.7.dylib" DPYTHON_INCLUDE_DIR= "/Library/Frameworks/amework/Versions/2.7/include/python2.7/" \ DCMAKE_INSTALL_RPATH= "/opt/dev/versions/vtk/vtk-7.1.0-shared/lib" \ DCMAKE_INSTALL_PREFIX= "/opt/dev/versions/vtk/vtk-7.1.0-shared" \ Here my updated call to cmake, where CMAKE_MACOSX_RPATH and CMAKE_INSTALL_RPATH make the difference: cmake -G Ninja. For me, the easiest was to build vtk with appropriate CMake flags. I guess one option is to use install_name_tool. There are different possibilities to achieve this. I'm pretty sure that many people have been relying on the DYLD_LIBRARY_PATH-hack and now struggle with the consequences of SIP - that's why I thought that the community might benefit from this quite lengthy question.Īfter a long struggle, I was able to solve the last bit of my problem.īy setting a fixed value for the RPATH Run-Path dependent Libraries of the installed binaries, my linking problems are gone. Placing the libs in the site-package location (of vtk) doesn't help however. Apparently, it helps to copy the dylibs into the current working directory, but this is not feasible for me.
INSTALL VTK FOR PYTHON3 MAC HOW TO
So, how to properly replace this "linkage hack" that worked perfectly well before MacOS 10.11.? Is there a way to still use DYLD_LIBRARY_PATH?ĭisabling SIP is not an option. Now the question: Apparently, DYLD_LIBRARY_PATH cannot be used in child-processes and hence should not be used anymore at all since El Capitan.

ImportError: No module named vtkCommonCorePythonīy now, I understand that the problem is caused by the System Integrity Protection (SIP) that has been introduced in El Capitan.

Module = self._system_import(name, *args, **kwargs)įile "/Library/Frameworks/amework/Versions/2.7/lib/python2.7/site-packages/vtk/_init_.py", line 41, in įile "/Library/Frameworks/amework/Versions/2.7/lib/python2.7/site-packages/vtk/vtkCommonCore.py", line 9, in If I try to import vtk in P圜harm's python console, I get the following error: Traceback (most recent call last):įile "/Library/Frameworks/amework/Versions/2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2881, in run_codeĮxec(code_obj, er_global_ns, er_ns)įile "/Applications/P圜harm.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import If I start python from the terminal, I can import vtk successfully. Note that I am required to extend the DYLD_LIBRARY_PATH by the location where the libs reside: /opt/dev/versions/vtk/vtk-7.1.0-shared/lib/. In my case, this is /Library/Frameworks/amework/Versions/2.7/lib/python2.7/site-packages
INSTALL VTK FOR PYTHON3 MAC INSTALL
Install the python package in a location where python can find it. DCMAKE_BUILD_TYPE=Release -DVTK_WRAP_PYTHON=ON -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX= "/opt/dev/versions/vtk/vtk-7.1.0-shared" -DPYTHON_INCLUDE_DIR= "/Library/Frameworks/amework/Versions/2.7/include/python2.7/" -DPYTHON_LIBRARY= "/Library/Frameworks/amework/Versions/2.7/lib/libpython2.7.dylib" For a summary, see the CMake call with which I configure vtk.

python 2.7.12, installed from under /Library/Frameworks/amework/īuild a python module locally.
