Kitware / paraview-trame-components

High level trame components for ParaView
Other
5 stars 1 forks source link

Issue with Web applications with ParaView & trame #7

Open abhishekchitwar opened 1 week ago

abhishekchitwar commented 1 week ago

Trying to understand the parallel post-processing with ParaView and trame as web app. However, facing following issue.

Reference

https://www.kitware.com/exposing-web-application-with-paraview-5-13-is-getting-simpler/
ParaView is using venv: .venv
Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.24090\bin\lib\site-packages\paraview\__init__.py", line 217, in <module>
    from .modules import vtkRemotingCore
ImportError: Failed to load vtkRemotingCore: No module named paraview.modules.vtkRemotingClientServerStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.24090\bin\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\ParaView 5.13.24090\bin\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\__init__.py", line 2, in <module>
    from .colors import ColorBy  # noqa: F401
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\colors.py", line 1, in <module>
    from paraview import simple
  File "C:\Program Files\ParaView 5.13.24090\bin\lib\site-packages\paraview\__init__.py", line 219, in <module>
    import _paraview_modules_static
ModuleNotFoundError: No module named '_paraview_modules_static'

Using latest nightly build of ParaView and Python 3.10.10

Appreciate guidance in this regard!

jourdain commented 1 week ago

Can you try with the release instead of nightly?

abhishekchitwar commented 1 week ago

Still issue persists!

mpiexec -n 4 pvbatch --venv .venv -m ptc.apps.sphere
ParaView is using venv: .venv
Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 217, in <module>
    from .modules import vtkRemotingCore
ImportError: Failed to load vtkRemotingCore: No module named paraview.modules.vtkRemotingClientServerStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\__init__.py", line 2, in <module>
    from .colors import ColorBy  # noqa: F401
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\colors.py", line 1, in <module>
    from paraview import simple
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 219, in <module>
    import _paraview_modules_static
ModuleNotFoundError: No module named '_paraview_modules_static'
ParaView is using venv: .venv
ParaView is using venv: .venv
ParaView is using venv: .venv
jourdain commented 1 week ago

Are you using the mpi from ParaView? Also try to pass a full path for the venv as I'm not sure how it get interpreted when processed via mpi.

abhishekchitwar commented 1 week ago

Using following MPI

mpiexec
Microsoft MPI Startup Program [Version 10.1.12498.52]
mpiexec -n 4 pvbatch --venv D:/Research/trame-app/paraview/.venv -m ptc.apps.sphere
ParaView is using venv: D:/Research/trame-app/paraview/.venv
Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 217, in <module>
    from .modules import vtkRemotingCore
ImportError: Failed to load vtkRemotingCore: No module named paraview.modules.vtkRemotingClientServerStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\__init__.py", line 2, in <module>
    from .colors import ColorBy  # noqa: F401
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\colors.py", line 1, in <module>
    from paraview import simple
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 219, in <module>
    import _paraview_modules_static
ModuleNotFoundError: No module named '_paraview_modules_static'
ParaView is using venv: D:/Research/trame-app/paraview/.venv
ParaView is using venv: D:/Research/trame-app/paraview/.venv
ParaView is using venv: D:/Research/trame-app/paraview/.venv
jourdain commented 1 week ago

I mean that mpiexec should come from inside C:\Program Files\ParaView 5.13.0\bin.

abhishekchitwar commented 1 week ago

Installed following version ParaView-5.13.0-MPI-Windows-Python3.10-msvc2017-AMD64.msi. I didn't find the mpiexec with mentioned path.

cquammen commented 1 week ago

Installed following version ParaView-5.13.0-MPI-Windows-Python3.10-msvc2017-AMD64.msi. I didn't find the mpiexec with mentioned path.

Indeed, on Windows, mpiexec is installed when you install MS-MPI. It should be in C:\Program Files\Microsoft MPI\Bin.

cquammen commented 1 week ago

I was able to start this example on my Windows machine with ParaView-5.13.0-MPI-Windows-Python3.10-msvc2017-AMD64.msi installed, so it should work.

The fact that you are seeing ParaView is using venv: D:/Research/trame-app/paraview/.venv 4 times suggests that you might be using a version of ParaView for Windows that does NOT support MPI. That message should appear only once. What does your PATH environment variable say? Is there a chance that there is another pvbatch being found?

Another suggestion: let's try without mpiexec for the moment. Can you run pvbatch --venv D:/Research/trame-app/paraview/.venv -m ptc.apps.sphere and see if a non-MPI version runs?

abhishekchitwar commented 1 week ago

Not sure what's going wrong, I have checked the env, only one version is set to path C:\Program Files\ParaView 5.13.0\bin\


D:\Research\trame-app\paraview_poc>pvbatch --venv .venv -m ptc.apps.sphere                                
ParaView is using venv: .venv
Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 217, in <module>
    from .modules import vtkRemotingCore
ImportError: Failed to load vtkRemotingCore: No module named paraview.modules.vtkRemotingClientServerStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\__init__.py", line 2, in <module>   
    from .colors import ColorBy  # noqa: F401
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\colors.py", line 1, in <module>     
    from paraview import simple
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 219, in <module>
    import _paraview_modules_static
ModuleNotFoundError: No module named '_paraview_modules_static'
jourdain commented 1 week ago

can you try running C:\Program Files\ParaView 5.13.0\bin\pvbatch.exe instead of plain pvbatch?

abhishekchitwar commented 1 week ago

Getting following O/P

D:\Research\trame-app\paraview_poc>"C:\Program Files\ParaView 5.13.0\bin\pvbatch.exe"
(   0.046s) [pvbatch         ]             pvpython.h:115    ERR| No script specified. Please specify a batch script or use 'pvpython'.
jourdain commented 1 week ago

Just to be clear the full command line should be

mpiexec -n 4  "C:\Program Files\ParaView 5.13.0\bin\pvbatch.exe" --venv "D:/Research/trame-app/paraview/.venv" -m ptc.apps.sphere
abhishekchitwar commented 1 week ago

Sorry! No! I think, need to reinstall it, still same O/P

mpiexec -n 4  "C:\Program Files\ParaView 5.13.0\bin\pvbatch.exe" --venv .venv -m ptc.apps.sphere                
ParaView is using venv: .venv
Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 217, in <module>
    from .modules import vtkRemotingCore
ImportError: Failed to load vtkRemotingCore: No module named paraview.modules.vtkRemotingClientServerStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\ParaView 5.13.0\bin\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\__init__.py", line 2, in <module>   
    from .colors import ColorBy  # noqa: F401
  File "D:\Research\trame-app\paraview_poc\.venv\Lib\site-packages\ptc\colors.py", line 1, in <module>     
    from paraview import simple
  File "C:\Program Files\ParaView 5.13.0\bin\Lib\site-packages\paraview\__init__.py", line 219, in <module>
    import _paraview_modules_static
ModuleNotFoundError: No module named '_paraview_modules_static'
ParaView is using venv: .venv
ParaView is using venv: .venv
ParaView is using venv: .venv
jourdain commented 1 week ago

Just out of curiosity, your venv has been built with Python 3.10?

abhishekchitwar commented 1 week ago

Thank you, @jourdain and @cquammen, for your guidance. I can now run the program as expected. To achieve this, I recreated the virtual environment and only installed the paraview-trame-components module. It appears there was a conflict with other modules I had installed in the virtual environment, which are: but need to check specifically.

https://github.com/ansys/pyfluent-visualization https://github.com/ansys/pydpf-core

D:\Research\trame-app\paraview_poc>mpiexec -n 4 pvbatch --venv .venv -m ptc.apps.sphere
ParaView is using venv: .venv
VisRTX 0.1.6, using devices: 
 0: NVIDIA RTX A2000 Laptop GPU (Total: 4.3 GB, Available: 3.4 GB)

image

jourdain commented 1 week ago

Probably vtk was conflicting with ParaView's VTK.