Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 1.75 KB

pip_install_vtk.md

File metadata and controls

63 lines (48 loc) · 1.75 KB

Installation of VTK in Blender 2.93 Python via Pip

Note: These instructions also likely work for other Blender and VTK versions, but the versions applied below are the ones tested for BVTKNodes.

On Windows

Run CMD.EXE as administrator and run commands

cd C:\Program Files\Blender Foundation\Blender\2.93\python\bin
python.exe -m ensurepip
python.exe -m pip install vtk==9.1.0

or if you need to install newest (possibly unsupported) version of vtk, replace last command with

python.exe -m pip install vtk

On Linux

Run on normal terminal commands

cd /path/to/blender-2.93/2.93/python/bin
./python3.7m -m ensurepip
./python3.7m -m pip install vtk==9.1.0

or if you need to install newest (possibly unsupported) version of vtk, replace last command with

./python3.7m -m pip install vtk

Testing

You can test if VTK is found in Blender Python Console (by default located in the Scripting workspace ) with commands

import vtk
vtk.vtkVersion().GetVTKVersion()

which should return VTK version number that was installed.

Workaround for VTK Import Error on Linux

Blender 2.93 and newer has an issue on Linux, where running import vtk command in Blender Python Console raises error

ImportError: /path/to/blender/2.93/python/lib/python3.9/site-packages/vtkmodules/libvtkPythonInterpreter-9.0.so: undefined symbol: Py_Main

Workaround for this issue is to edit file /path/to/blender/2.93/python/lib/python3.9/site-packages/vtkmodules/all.py and disable import of vtkRenderingMatplotlib by commenting out the line like so:

# from .vtkRenderingMatplotlib import *