Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paraview_hello_world.ipynb doesn't work on Colab #1467

Open
AgnieszkaZaba opened this issue Dec 14, 2024 · 12 comments
Open

paraview_hello_world.ipynb doesn't work on Colab #1467

AgnieszkaZaba opened this issue Dec 14, 2024 · 12 comments
Assignees

Comments

@AgnieszkaZaba
Copy link
Collaborator

I tried to run this notebook on Colab, on MacOs 14 and Ubuntu. I can't make it work.
First error that I get is
FileNotFoundError: [Errno 2] No such file or directory: 'pvpython'

On Ubuntu I managed to pass this error to another one
CalledProcessError: Command '['ffmpeg', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-s', '1120x1488', '-pix_fmt', 'rgba', '-framerate', '10.0', '-loglevel', 'error', '-i', 'pipe:', '-vcodec', 'h264', '-pix_fmt', 'yuv420p', '-y', '/tmp/tmpodqfrsid/temp.m4v']' returned non-zero exit status 234.

It's connected to missing data_range parameter in update function (in a line plots[i].update(ncdf.variables[product][frame_num], step=step) )

After setting it to None there is a different error
`---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[22], line 1
----> 1 np.full_like(ncdf.variables['surf_precip'][:], np.nan)

KeyError: 'surf_precip'`

Please help me :)
Maybe tutorial on HOWTO actually set paraview?

@slayoo
Copy link
Member

slayoo commented Dec 15, 2024

!pip install python3-paraview will, in principle, work on Colab and result in availability of the pvpython command.

@AgnieszkaZaba
Copy link
Collaborator Author

AgnieszkaZaba commented Dec 15, 2024 via email

@slayoo
Copy link
Member

slayoo commented Dec 15, 2024

Please help me :) Maybe tutorial on HOWTO actually set paraview?

We'd probably be better off directing users to existing tutorials on Paraview, e.g. https://docs.paraview.org/en/latest/Tutorials/SelfDirectedTutorial/

@AgnieszkaZaba
Copy link
Collaborator Author

!pip install python3-paraview getting me an error:

ERROR: Could not find a version that satisfies the requirement python3-paraview (from versions: none)
ERROR: No matching distribution found for python3-paraview

@slayoo
Copy link
Member

slayoo commented Dec 15, 2024

sorry! apt-get install python3-paraview

@slayoo
Copy link
Member

slayoo commented Dec 15, 2024

image

@AgnieszkaZaba
Copy link
Collaborator Author

It's running but I can't get results. It's running pvpython for 2 hours now and Colab is disconnecting me. I don't know how else I can run it.

@AgnieszkaZaba
Copy link
Collaborator Author

uff, I got results!!
Finally I have path to Paraview permanently set in PATH and it is working! 🎉

On MacOs 14 I had to add PATH to ~/.zshrc file.

@AgnieszkaZaba AgnieszkaZaba self-assigned this Dec 19, 2024
@AgnieszkaZaba
Copy link
Collaborator Author

I added

if 'google.colab' in sys.modules:
    !sudo apt-get -qq install python3-paraview
    !sudo ln -s /usr/lib/libpdal_base.so.15 /usr/lib/libpdal_base.so.13 # workaround for Ubuntu package bug

It works fine. But maybe we can also think why it is taking significantly longer on Colab.

@slayoo
Copy link
Member

slayoo commented Dec 22, 2024

It works fine. But maybe we can also think why it is taking significantly longer on Colab.

No idea...

BTW, there is also a tool called ipyparaview: https://github.com/NVIDIA/ipyparaview (" iPython widget for server-side ParaView rendering in Jupyter. ")

@slayoo
Copy link
Member

slayoo commented Dec 26, 2024

addressed in #1481

@slayoo slayoo closed this as completed Dec 26, 2024
@AgnieszkaZaba
Copy link
Collaborator Author

I don't thing it is working. It did not render any results. Line subprocess.run() is running without error and without output.
If I try to run ! pvpython pvscript.py I got the following

Traceback (most recent call last):
  File "/content/pvscript.py", line 2, in <module>
    from paraview import simple as pvs
ModuleNotFoundError: No module named 'paraview'

Loguru caught a signal: SIGSEGV
malloc_consolidate(): unaligned fastbin chunk detected

Loguru caught a signal: SIGABRT

Loguru caught a signal: SIGINT

I changed python version from 3.10 to 3.9 and it did not helped.

Some propositions

  • extra installation on Colab?
  • using ipyparaview instead of python3-paraview?
  • adding env path? (but it is in same place pvpython, pvbatch, paraview and it is in /usr/bin which is in PATHS)

@AgnieszkaZaba AgnieszkaZaba reopened this Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants