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

**URL:** <https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737>\
**Category:** Development\
**Created:** [November 26, 2020, 2:07pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737 "2020-11-26T14:07:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.vtk.org/u/seanm)\
**Post date:** [November 26, 2020, 2:07pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/1 "2020-11-26T14:07:06Z")

</div>

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:

```auto
Traceback (most recent call last):
  File "/Users/builder/external/VTK/Utilities/vtkTclTest2Py/rtImageTest.py", line 12, in <module>
    import vtk
  File "/Users/builder/external/VTK-clang-dbg-x86_64/lib/python2.7/site-packages/vtk.py", line 9, in <module>
    vtkmodules_m = importlib.import_module('vtkmodules')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/ __init__.py", line 37, in import_module
    __import__ (name)
  File "/Users/builder/external/VTK-clang-dbg-x86_64/lib/python2.7/site-packages/vtkmodules/ __init__.py", 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?

Thanks,

Sean

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [November 26, 2020, 2:09pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/2 "2020-11-26T14:09:38Z")

</div>

@ben.boeckel

---

<div class="post-metadata">

**Author:** ![seanm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.vtk.org/u/seanm)\
**Post date:** [December 2, 2020, 3:29am UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/3 "2020-12-02T03:29:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [December 2, 2020, 9:16am UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/4 "2020-12-02T09:16:08Z")

</div>

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:

```auto
ImportError: No module named _vtkmodules_static

```

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

---

<div class="post-metadata">

**Author:** ![seanm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.vtk.org/u/seanm)\
**Post date:** [December 2, 2020, 5:32pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/5 "2020-12-02T17:32:02Z")

</div>

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

[https://cmake.org/cmake/help/latest/release/3.18.html#id2](https://cmake.org/cmake/help/latest/release/3.18.html#id2)

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

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

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [December 3, 2020, 4:23am UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/6 "2020-12-03T04:23:20Z")

</div>

@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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![seanm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/a88e4f/32.png) [@seanm](https://discourse.vtk.org/u/seanm)\
**Post date:** [December 3, 2020, 7:09pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/7 "2020-12-03T19:09:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [March 21, 2021, 9:17pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/8 "2021-03-21T21:17:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)\
**Post date:** [March 21, 2021, 11:37pm UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/9 "2021-03-21T23:37:42Z")

</div>

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

```bash
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

```

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)\
**Post date:** [March 22, 2021, 12:22am UTC](https://discourse.vtk.org/t/cmake-3-17-2-to-3-18-4-update-seems-to-have-made-all-python-tests-fail/4737/10 "2021-03-22T00:22:42Z")

</div>

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