timofeymukha / turbulucid

A Python package for visualising 2D CFD datasets.
https://timofeymukha.github.io/turbulucid/
GNU General Public License v3.0
56 stars 27 forks source link

Incompatible with vtk 8.2.x #6

Closed AlexanderDeltares closed 3 years ago

AlexanderDeltares commented 3 years ago

Turbulucid installs without problems, but an error encountered when trying to import it. This limits the available python version when using Anaconda to 3.6.

The following error is shown when trying to import turbulucid:


ImportError Traceback (most recent call last) ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\vtkmodules\vtkIOParallel.py in 4 # use relative import for installed modules ----> 5 from .vtkIOParallelPython import * 6 except ImportError:

ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last)

in ----> 1 import turbulucid ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\turbulucid-0.2-py3.7.egg\turbulucid\__init__.py in 4 # See LICENCE.txt and the Legal section in the README for more information 5 ----> 6 from . import core 7 from .core import * 8 ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\turbulucid-0.2-py3.7.egg\turbulucid\core\__init__.py in 4 # See LICENCE.txt and the Legal section in the README for more information 5 ----> 6 from .case import * 7 from .plotting import * 8 from .data_extraction import * ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\turbulucid-0.2-py3.7.egg\turbulucid\core\case.py in 8 from __future__ import print_function 9 import numpy as np ---> 10 from vtk.util.numpy_support import numpy_to_vtk 11 from vtk.util.numpy_support import vtk_to_numpy 12 import os ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\vtk.py in 30 all_spec = importlib.util.find_spec('vtkmodules.all') 31 all_m = importlib.util.module_from_spec(all_spec) ---> 32 all_spec.loader.exec_module(all_m) 33 34 # import vtkmodules ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\vtkmodules\all.py in 81 from .vtkIONetCDF import * 82 from .vtkIOPLY import * ---> 83 from .vtkIOParallel import * 84 from .vtkIOParallelXML import * 85 from .vtkIOSQL import * ~\AppData\Local\Continuum\anaconda3\envs\Turbulucid\lib\site-packages\vtkmodules\vtkIOParallel.py in 7 # during build and testing, the modules will be elsewhere, 8 # e.g. in lib directory or Release/Debug config directories ----> 9 from vtkIOParallelPython import * ModuleNotFoundError: No module named 'vtkIOParallelPython'
timofeymukha commented 3 years ago

Hi @AlexanderDeltares , thanks for this report. I have been experiencing similar issues, and also had similar reports from other users. However, my understanding is that the issue here is not turbulucid, but rather vtk. You can check that by trying to import vtk, if that crashes, then it is vtk that is the problem.

What I currently did on my machine is create a new environment and install vtk from the conda-forge channel. That seems to make it work. However, it only works in that one environment, which is actually very annoying. I hope this is solved at some point.

AlexanderDeltares commented 3 years ago

The error indeed occurs on importing vtk. Good to know that the issue is with vtk then. Thanks for letting me know that vtk from conda-forge seems to work. I will try that in the future.

timofeymukha commented 2 years ago

@AlexanderDeltares may be of interest to you: https://gitlab.kitware.com/vtk/vtk/-/issues/18381

I will rework the vtk imports in the package soon so that this import issue is hopefully gone.