Wrapping: PyCharm and TBB
This is windows specific and relates to the VTK Master.
If VTK_SMP_IMPLEMENTATION_TYPE
is set to tbb
then when using PyCharm we get the following error:
C:\Users\amaclean\Miniconda3\envs\VTK\python.exe D:/Users/amaclean/Development/Kitware/src/vtk-examples/src/Python/Visualization/CurvatureBandsWithGlyphs.py
Traceback (most recent call last):
File "D:\Users\amaclean\Development\Kitware\build\VTK\bin\Lib\site-packages\vtkmodules\__init__.py", line 50, in <module>
from . import vtkCommonCore
ImportError: DLL load failed while importing vtkCommonCore: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Users\amaclean\Development\Kitware\src\vtk-examples\src\Python\Visualization\CurvatureBandsWithGlyphs.py", line 5, in <module>
import vtk
File "D:\Users\amaclean\Development\Kitware\build\VTK\bin\Lib\site-packages\vtk.py", line 30, in <module>
all_m = importlib.import_module('vtkmodules.all')
File "C:\Users\amaclean\Miniconda3\envs\VTK\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "D:\Users\amaclean\Development\Kitware\build\VTK\bin\Lib\site-packages\vtkmodules\__init__.py", line 52, in <module>
import _vtkmodules_static
ModuleNotFoundError: No module named '_vtkmodules_static'
Process finished with exit code 1
During the build lots of warnings warning C4324: 'tbb::detail::d1::task': structure was padded due to alignment specifier
are generated for the VTK C++ classes and the Python wrapping.
If VTK_SMP_IMPLEMENTATION_TYPE
is set to sequential
then there are no issues with PyCharm.
Note that a command such as:
python D:\Users\amaclean\Development\Kitware\src\vtk-examples\src\Python\Visualization\CurvatureBandsWithGlyphs.py
works Ok in both cases, so it seems to be some issue with PyCharm, probably triggered by this commit: 514578f5
I am using oneapi-tbb-2021.1.1, PyCharm 2020.3.5 (Community Edition), Python 3.9.2
. I have invalidated caches and restarted PyCharm, also removed all plugins. The virtual environment that I use hasn't changed and was working OK.