nschloe / meshio

:spider_web: input/output for many mesh formats
MIT License
1.94k stars 399 forks source link

[BUG] ModuleNotFoundError in Paraview #1378

Open alishayegh opened 1 year ago

alishayegh commented 1 year ago

Describe the bug meshio is installed using conda; however, when loading meshio plugin in Paraview, meshio cannot be found.

To Reproduce

Generic Warning: In vtkPVPythonAlgorithmPlugin.cxx, line 184
Failed to load Python plugin:
Failed to call `paraview.detail.pythonalgorithm.load_plugin`.

Traceback (most recent call last):
  File "/home/maalek/ParaView-5.11.0-MPI-Linux-Python3.9-x86_64/lib/python3.9/site-packages/paraview/detail/pythonalgorithm.py", line 509, in load_plugin
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/maalek/anaconda3/share/paraview-5.9/plugins/paraview-meshio-plugin.py", line 12, in <module>
    import meshio
ModuleNotFoundError: No module named 'meshio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maalek/ParaView-5.11.0-MPI-Linux-Python3.9-x86_64/lib/python3.9/site-packages/paraview/detail/pythonalgorithm.py", line 513, in load_plugin
    module = imp.load_source(modulename, filepath)
  File "/home/maalek/ParaView-5.11.0-MPI-Linux-Python3.9-x86_64/lib/python3.9/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/maalek/anaconda3/share/paraview-5.9/plugins/paraview-meshio-plugin.py", line 12, in <module>
    import meshio
ModuleNotFoundError: No module named 'meshio'
ERROR: In vtkPVPluginLoader.cxx, line 536
vtkPVPluginLoader (0x16cf1230): /home/maalek/anaconda3/share/paraview-5.9/plugins/paraview-meshio-plugin.py: /home/maalek/anaconda3/share/paraview-5.9/plugins/paraview-meshio-plugin.py: invalid ELF header
alishayegh commented 1 year ago

It was a problem with numpy version; numpy should be updated by

pip install -U numpy

[from here]

But I expected that this is automatically done when installation command is issued (pip or conda)

alishayegh commented 1 year ago

It was a problem with numpy version; numpy should be updated by

pip install -U numpy

[from here]

But I expected that this is automatically done when installation command is issued (pip or conda)

Using the solution above you'll end up with a working meshio installation which still gives the above mentioned error if it is loaded in Paraview.