Cannot open VTK output file

@Y_Guo - thanks for the report, and sorry for the difficulty. I am looking into this today, will let you know as soon as this is sorted out.

– Charles

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.

$ locate libtbb.so.2
/home/cgw/anaconda3/lib/libtbb.so.2

As a workaround, we can use LD_LIBRARY_PATH:

$ LD_LIBRARY_PATH=/home/cgw/anaconda3/lib python -c 'import vtk'
(no output, command succeeded)


$ LD_LIBRARY_PATH=/home/cgw/anaconda3/lib mfix
(works!  MFiX runs and opens VTK window.)

This is a workaround than a real solution - we’ll release an updated MFiX package ASAP.

– Charles

This is the same problem reported at
https://www.biostars.org/p/494922/

Instead of the LD_LIBRARY_PATH workaround I mentioned above, it’s probably better to do

conda install -n mfix-21.1.1 tbb=2020.1

which fixes the problem without requiring LD_LIBRARY_PATH every time you start MFIX

On Windows, tbb version 2020.1 does not exist. Use

conda install -n mfix-21.1.1 tbb=2020.2

@daoney @DillonLabban @waleedfaried @Y_Guo (and anyone else who’s experienced the VTK problem)

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.

Thanks for the bug reports and the patience.

– Charles

Hi Charles,

Thanks for looking into this.

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’

Can you please post the output of conda list?

@DillonLabban

In addition to conda list as Jeff asked, I’d also like to know what happens if you go into an Anaconda prompt and type

python -c import vtk

From the message above I see that it’s a DLL problem, but it’s not clear exactly which DLL is the cause.

– Charles

See the attached text file anaconda3_condalist_vtkimport.txt (18.0 KB)

I meant once you have activated the mfix-21.1.2 environment:

conda activate mfix-21.1.2
conda list

and look for the version of tbb. It should be

tbb 2020.2 h59b6b97_0

Also try to put quotes around the “import vtk”:

python -c “import vtk”

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.

– Charles

My mistake. See the attached text file for these opened in the mfix environment. anaconda3_condalist_vtkimport_updated.txt (8.6 KB)

the tbb version appears to match what you’ve specified.

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:

conda install -c conda-forge jsoncpp==1.8.1

and let us know if this helps.

Using conda install -c conda-forge jsoncpp==1.8.1 has resulted in the MFiX vtk/3D modeling functioning properly in the mfix-21.1.2 environment!

Thank you very much Charles and Jeff for working with us on this issue.

1 Like

Thank you for your patience. We will do another point release on Monday to address this issue, and hopefully this work around will be sufficient till then.

thanks you this work for me

Hi,Jeff. I’m sorry to disturb you, I have tried all ways mentioned above but still failed to solve this problem. What can I do?

@Y_Guo : We want to help you get this sorted out. Are you on Windows or Linux? What version of the Anaconda installer are you using? What’s the error you are getting?

– Charles

I also run the “conda install -c conda-forge jsoncpp==1.8.1” on both windows and Linux but it did not help. I am using anaconda 4.10.1 and python 3.7.10
In addition, I found the button under the geometry column can not work normally. It did not allow me to introduce the STL file.