0
$\begingroup$

I install vtk with homebrew (brew install vtk --with-python3 --without-python) on my MacOSX system. Now I go in the Terminal shell, I start python3. Then I write import vtk and it works.

For the record, this is the python version installed with homebrew.

Python 3.5.1 (default, Apr 18 2016, 03:49:24)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin

And this is the one shipped with Blender 2.77a

PYTHON INTERACTIVE CONSOLE 3.5.1 (default, Feb  1 2016, 13:40:14)  
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

So I'm confident this will behave the same in Blender. I launch it, go in the console and write the following:

import sys sys.path.append('/usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages/') import vtk

And that's a guaranteed crash

This isn't the first library I try to use which crashes at import time even if it works just fine in any other python environment. I doubt there's an easy solution (don't mention recompiling please). At least people reading this will know there's a problem and won't waste too much time on it...

$\endgroup$
  • $\begingroup$ Try copying /usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages/ to blender-2.77a/2.77/python/lib/python3.5/. $\endgroup$ – someonewithpc Sep 1 '16 at 20:49
  • $\begingroup$ I did that already, same behaviour $\endgroup$ – nantille Sep 2 '16 at 7:27
1
$\begingroup$

I have had success with this method:

I'm using Blender 2.78 with python 3.5. And I installed latest vtk through homebrew.

import sys
sys.path.append("/usr/local/Cellar/vtk/7.1.1/lib/python3.6/site-packages")
import vtk

No problem, and https://github.com/cwant/VTKBlender module has been updated, so you might want to check that out

$\endgroup$
0
$\begingroup$

I tried numerous method from compiling from source the vtk library to using brew. the version on python installed with brew was not the same than the one of blender and then importing vtk module in blender made blender crash every time. Apparently it was a conflict with the version of numpy of blender and my python(3.5.4 at the time)

I gave it a try one last time today. I decided to start from fresh. So I remove all my previous installation of python and etc... (ports alll...) and i just install vtk using brew:

brew install vtk --with-python3 --without-python

Then in the blender's console:

 import sys
 sys.path.append("/usr/local/Cellar/vtk/7.1.1/lib/python3.6/site-packages")
 import vtk
 from vtk.utils import tomato 

It worked. So Nicolas maybe you should also give it a try.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.