Could not import VTK, please check your installation.
traceback:
Traceback (most recent call last):
File “C:\Users\Steve\anaconda3\envs\mfix-20.4.3\lib\site-packages\vtkmodules\vtkCommonCore.py”, line 5, in
from .vtkCommonCorePython import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\Steve\anaconda3\envs\mfix-20.4.3\lib\site-packages\mfixgui\vtk_widgets_init_.py”, line 8, in
import vtk
File “C:\Users\Steve\anaconda3\envs\mfix-20.4.3\lib\site-packages\vtk.py”, line 32, in
all_spec.loader.exec_module(all_m)
File “C:\Users\Steve\anaconda3\envs\mfix-20.4.3\lib\site-packages\vtkmodules\all.py”, line 7, in
from .vtkCommonCore import *
File “C:\Users\Steve\anaconda3\envs\mfix-20.4.3\lib\site-packages\vtkmodules\vtkCommonCore.py”, line 9, in
from vtkCommonCorePython import *
ModuleNotFoundError: No module named ‘vtkCommonCorePython’
Hi - this looks like an installation problem - can you tell us how you installed MFiX? Are you using the Conda package, or something else? It looks like you don’t have VTK installed correctly, Conda should have handled this dependency.
Also note - we’ve released 21.1, you should upgrade from 20.4 to that version.
This same problem is occurring for the 21.1 installation installed via Anaconda3 (Conda package) using the provided instructions. The VTK files it is saying are missing are showing up properly in the installation folder, so I do not know why they are not being imported correctly. I’ve tried using both the current and previous Anaconda3 release versions, neither work. I’ve also tried using several different MFiX release versions and it still does not work. The Anaconda3 versions I’m downloading are for Windows 64-bit, the MFiX versions are for Windows.
I reinstalled both Anaconda3 and MFiX on two different machines (both 64-bit Windows OS) and still received the same error. I followed the provided instructions from the download MFiX webpage.
Unfortunately, I am using MFiX for a project assigned as part of my college course curriculum and it is specifically mentioned to use MFiX 20.4
I do not have an answer for this yet. But searching Google I see that this problem has been reported frequently in the past (for other apps using VTK, not MFiX).
The answers I’ve seen online fall into these categories:
32-bit libraries vs 64-bit - are you sure you installed the 64-bit Anaconda?
version mismatches between the Python used to build VTK, vs the Python version at runtime
PYTHONPATH environment variable not containing the path to the vtk libraries
Are any of these relevant in your case? We will continue to investigate this problem, thanks for your patience.
Hi Charles, I met the same problem today when I install mfix on linux system. I find that the default python version are 3.8 but when I open the files: Anaconda3-envs-mfix-21.1.1-lib, I find that python3.7 is installed. Why does it occur this phenomenon? And how can I solve this problem? Looking forward your reply. Thank you.
the detailed error is as follows:
Could not import VTK, please check your installation.
traceback:
Traceback (most recent call last):
File “/home/user/anaconda3/envs/mfix-21.1.1/lib/python3.7/site-packages/vtkmodules/vtkCommonCore.py”, line 5, in
from .vtkCommonCorePython import *
ImportError: libtbb.so.2: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/user/anaconda3/envs/mfix-21.1.1/lib/python3.7/site-packages/mfixgui/vtk_widgets/init.py”, line 8, in
import vtk
File “/home/user/anaconda3/envs/mfix-21.1.1/lib/python3.7/site-packages/vtk.py”, line 32, in
all_spec.loader.exec_module(all_m)
File “/home/user/anaconda3/envs/mfix-21.1.1/lib/python3.7/site-packages/vtkmodules/all.py”, line 7, in
from .vtkCommonCore import *
File “/home/user/anaconda3/envs/mfix-21.1.1/lib/python3.7/site-packages/vtkmodules/vtkCommonCore.py”, line 9, in
from vtkCommonCorePython import *
ModuleNotFoundError: No module named ‘vtkCommonCorePython’
There seems to be an issue with the vtk package in Conda. It depends on a library called libtbb.so.2 but this is not getting installed properly. We can test the import outside of MFiX by running python -c import vtk
$ conda env list
# conda environments:
#
base * /home/cgw/anaconda3
mfix-21.1.1 /home/cgw/anaconda3/envs/mfix-21.1.1
$ conda activate mfix-21.1.1
$ which python
/home/cgw/anaconda3/envs/mfix-21.1.1/bin/python
$ python --version
Python 3.7.10
$ python -c 'import vtk'
Traceback (most recent call last):
File "/home/cgw/anaconda3/envs/mfix-21.1.1/lib/python3.7/site-packages/vtkmodules/vtkCommonCore.py", line 5, in <module>
from .vtkCommonCorePython import *
ImportError: libtbb.so.2: cannot open shared object file: No such file or directory
[...text deleted...]
ModuleNotFoundError: No module named 'vtkCommonCorePython'
This message makes it look like vtkCommonCorePython was not found, but the real problem is that this module depends on libtbb.so.2, as was reported earlier in the message.
The file is present, but it’s in the base environment rather than the mfix-21.1.1 environment.
I just uploaded a new version, 21.1.2, to the website which should fix the VTK installation issue. Please give it a try and post here if you have any further problems.
This problem is due to some recent changes in Anaconda (an update to libtbb left VTK without one of its needed dependencies), and we didn’t see it here because I was using a slightly older Anaconda version.
I’m still receiving a similar error using the updated MFiX 21.1.2 release for Windows 10/64-bit installed via the latest 64-bit Anaconda3 software:
Could not import VTK, please check your installation.
traceback:
Traceback (most recent call last):
File “C:\Users\dillo\anaconda3\envs\mfix-21.1.2\lib\site-packages\vtkmodules\vtkIOParallel.py”, line 5, in
from .vtkIOParallelPython import *
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Users\dillo\anaconda3\envs\mfix-21.1.2\lib\site-packages\mfixgui\vtk_widgets_init_.py”, line 8, in
import vtk
File “C:\Users\dillo\anaconda3\envs\mfix-21.1.2\lib\site-packages\vtk.py”, line 32, in
all_spec.loader.exec_module(all_m)
File “C:\Users\dillo\anaconda3\envs\mfix-21.1.2\lib\site-packages\vtkmodules\all.py”, line 83, in
from .vtkIOParallel import *
File “C:\Users\dillo\anaconda3\envs\mfix-21.1.2\lib\site-packages\vtkmodules\vtkIOParallel.py”, line 9, in
from vtkIOParallelPython import *
ModuleNotFoundError: No module named ‘vtkIOParallelPython’
Thanks Jeff - right, I meant to type python -c "import vtk", thanks for the correction.
What’s interesting to me about this traceback is that it doesn’t mention tbb, it’s different from the error that was reported at the beginning of this thread.
It doesn’t mention any particular DLL (it could still be libtbb but we don’t know) and the error is different:
The first one:
ImportError: DLL load failed: The specified module could not be found.
The new error Dillon reported:
ImportError: DLL load failed: The specified procedure could not be found.
“Specified module” vs “specified procedure” - I
It would be helpful if the error message told us which module or procedure!
I think “the specified module” error means a file is missing, while the “specified procedure” means that the file is found, but there are unresolved external symbols.
I install mfix-21.1.2 and meet the same problem with DillonLabban, when I follow your reply, I find that the tbb version is 2020.2 hff7bd54_0 and type python -c "import vtk" and it shows:
(mfix-21.1.2) user@user-virtual-machine:~$ python -c “import vtk”
File “”, line 1
“import
^
SyntaxError: invalid character in identifier
I can’t understand what has happened and it still occurs the problem I meet today. So what can I do now?
There seems to be some issues with the latest anaconda and vtk. Please try to downdrade jsoncpp by typing the following while in the mfix-21.1.2 environment: