Building pyQT and pyVTK for Windows

Has managed me so to get in touch =) Okay. After searching, I found a good page .


1. Install CMake. Download and put
2. Downloading and unpacking VTK
3. Installation QT for example in C: / Qt
4. Installation Visual Studio
5. Configuration of VTK with CMake
This is iterative process – select some, click Configure, again select, click, until the OK button is available.
Set the vtkWrappingPython , VTK_Group_Qt checkboxes
For Cmake_prefix_path , put something like: C: /Qt/5.11.0/msvc2015_64
For Qt5_dir : C: /Qt/5.11.0/msvc2015_64/lib/cmake/Qt5

Be prepared that the installations are not fast 🙂


Find vtkPython binary in VTK dir – it is the analogue of the python command, only with the corresponding appendage. Run it and check: `import vtk`. If no errors – congratulations! Otherwise – repeat the configuration.
For convenience, add vtkPython to PATH.

Versions of the used good (windows 10 x64):

Cmake 3.11.3
Microsoft Visual Studio Community 2017 Version 15.7.3
Python 3.6.5 x64
Qt 5.11.0 msvc15_64

PS. This is all I needed to build spycer
Therefore I also did pip install cx_Freeze and then:
vtkpython build and got an exe.

PPS. Compare with the installation on ubuntu:

sudo apt-get install python3-pyqt5
sudo apt-get install python-pyvtk
0 0 vote
Рейтинг статьи
2 комментариев
Newest Most Voted
Inline Feedbacks
View all comments

Если использовать те же самые версии, возможно сборка пройдет без проблем. Но на последних версиях Cmake(3.15) , Studio(2019), vtk (8.2.2), Python (3.7) , процесс идет с большими проблемами. Сбилдить так и не получилось данным способом. Затык при импорте VTK, вылезают ошибки “no module named ‘vtkRenderingQtPython'”.
fatal error LNK1181: cannot open input file ‘..\..\lib\Release\vtkCommonDataModelPython37D-8.1.lib’

Под windows есть альтернативный вариант установки:

pip install pyqt5 vtk pyvtk

Проверен на Windows 10, Visual studio 2019, python 3.7 x64