CMake 3.17.2 to 3.18.4 update seems to have made all python tests fail?

Hi all,

For weeks now, the dashboards I submit have been very non-green. There are a huge number of tests failing, just about all of them Python tests. ex: On Rogue14, things were ok on 2020-10-12 then ~700 test started failing the day after.

I keep a log of changes to my bots, and on 2020-10-12 that bot was updated from CMake 3.17.2 to 3.18.4. Presumably that was the cause.

Example error output:

Traceback (most recent call last):
  File "/Users/builder/external/VTK/Utilities/vtkTclTest2Py/", line 12, in <module>
    import vtk
  File "/Users/builder/external/VTK-clang-dbg-x86_64/lib/python2.7/site-packages/", line 9, in <module>
    vtkmodules_m = importlib.import_module('vtkmodules')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/", line 37, in import_module
  File "/Users/builder/external/VTK-clang-dbg-x86_64/lib/python2.7/site-packages/vtkmodules/", line 15, in <module>
    import _vtkmodules_static
ImportError: No module named _vtkmodules_static

I don’t know much about CMake or Python. Can anyone help?




So I tried different versions of CMake to squeeze the issue.

CMake 3.17.2 : good
CMake 3.17.5 : good
CMake 3.18.0 : good
CMake 3.18.1 : good
CMake 3.18.2 : bad
CMake 3.18.4 : bad
CMake 3.19.0 : bad
CMake 3.19.1 : bad

Just a guess, was there a change in Python versions between CMake 3.18.1 & 3.18.2 or the CMake VTK options at that point?
If I get messages like:

ImportError: No module named _vtkmodules_static

it may indicate a CMake Python option or Python version changed.

Nothing in the cmake release notes here jumps out to me:

I guess I could file a ticket with the cmake project…

Am I the only one seeing this issue? Maybe it’s Mac-only?

@seanm I don’t have a Mac but I am in the process of updating Python to Python 3.9 on Windows and Kubuntu.
If I update Python but don’t rebuild VTK to pick up the new version of Python I get this error when running a python script:

ModuleNotFoundError: No module named '_vtkmodules_static'

Once I rebuild VTK it is all Ok. When rebuilding VTK for a new version of Python I usually remove all Python related files then run CMake again.

Hope this helps.

Andrew, I’ve not touched my python installation at all. It’s just the ancient 2.7 version that comes with macOS.

There were some FindPython changes between 3.18.1 and 3.18.2. Is this still occurring today?

I haven seen any issues on Windows/Linux. I am using CMake 3.19.4. Just ran the Python tests now on Linux.

99% tests passed, 3 tests failed out of 724


The following tests FAILED:
        911 - VTK::FiltersModelingPython-TestImprintFilter (Failed)
        912 - VTK::FiltersModelingPython-TestImprintFilter2 (Failed)
        1962 - VTK::FiltersCorePython-TestWindowedSincPolylineSmoothing (Failed)
Errors while running CTest

That makes sense; I think those tests were fixed more recently on master.

1 Like