-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Gempy-viewer 3d #954
Comments
Hi Mike, In order to determine what could be the cause, we need more information on your system, setup (Python), etc. please see the template for issues. But as a quick info: here a link to an very simple model setup, which you can run in Google Colab (including 3D vis) - maybe this helps, as well: https://colab.research.google.com/drive/1-trAjwKkGPsF6PkRxoFJ1EJzjZ-3YQZj?usp=sharing Kind regards, Florian |
(Quick addition: if you click on "Issues -> Bug Report", then you see a list of questions that could help finding an answer) |
Extended answer, with some more time :-) and some more points to check: Firstly, GemPy has recently been updated to version 3 and there might be some compatibility issues with the tutorials you are using. Please make sure the tutorials you're following are updated for the version of GemPy that you're using. Secondly, the problem of the kernel resetting and 'gpv-3d' being undefined could be due to an issue with the installation or a missing dependency. Some users have had success solving similar problems by reinstalling GemPy in a fresh Python environment, preferably Python 3.8 or 3.9, as some issues have been reported with Python 3.9+ (see this issue). In addition, ensure to install GemPy using pip in a fresh environment as explained in this issue. Theano is not required anymore so if you were following an old guide that suggested installing it, please disregard that step. If these steps do not solve your problem, there might be an issue with your VTK installation. Some users have reported issues with VTK not working correctly on certain systems. Make sure you have the latest version of VTK installed and that it is correctly configured for your system. Lastly, there are some known issues when trying to use the 3D viewer in Jupyter notebooks. The 3D viewer should open in a new window outside of the notebook. If you are not seeing this window, it could be due to an issue with your display settings or a problem with the installation of pyvista, a library that GemPy uses for 3D visualization. Please ensure that pyvista is correctly installed and working as expected. You can test this by trying to run one of the pyvista examples. If none of these suggestions solve your problem, please provide more information about your system (operating system, Python version, how you installed GemPy) and any error messages you are seeing. This will help us diagnose the problem more accurately. I hope this helps. Let me know if you have any other questions. |
Hi @malflink, maybe just two small additional points. Python 3.12.4 works fine with gempy, so you do not need (should not) go back to 3.8 or 3.9. ` |
I've been trying to help @malflink with this and I'm able to reproduce the problem in his environment, in a fresh environment (Ubuntu 22.04 VM), and in my own environment (macOS). On all of these my Ipython kernel dies after I attempt to call any variant of Steps to reproduce include:
Exported Environment
EDIT:
|
Thank you for the additional explanations and the details on environment, @EternalDeiwos! I tried with a fresh install on MacOS 13.7 and it works for me with the inline plot using Also, looking at your installs: can you try in a normal Jupyter notebook instead of JupyterLab? Concerning the install on Ubuntu: this could be due to a problem in an external package. Can you try adding these two:
|
Both the inline and external plots killed the kernel without any error message or explanation. On the VM, I tried to troubleshoot the I did manage to get the vtk demo to work on my Mac once I installed Regarding Jupyter notebook, this suggestion seems odd to me since it has been deprecated for some time. I can take another pass at this but it doesn’t seem likely to be the source of a problem. |
Okay, I have managed to get it to work on a fresh VM following these instructions conda install nodejs # required when importing pyvista in Jupyter
pip install pyvista trame
sudo apt-get update
sudo apt install libgl1-mesa-glx xvfb --fix-missing
# Can be skipped if using the helper
export DISPLAY=:99.0
export PYVISTA_OFF_SCREEN=true
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# Run Jupyter Lab
jupyter lab from pyvista import demos
demos.plot_wave() The reason why this worked is probably because I didn't set the environment variables or start import pyvista
# Sets up env vars and starts xvfb server
pyvista.start_xvfb() |
Hello @EternalDeiwos, thanks a lot for the detailed solution. It looks like this is a Pyvista/VM/Remote server issue though, correct? @malflink can you confirm that this works for you? |
I will check today.
Mike
|
Thanks for the detailed answer! However, not sure what you mean with the Jupyter notebooks - I am using them, for example, in VS Code https://code.visualstudio.com/docs/datascience/jupyter-notebooks and, as far as I know, they are still part of the Anaconda distribution, etc. Anyway, great to see that you found a way to get pyvista working. |
Hi, Sets up env vars and starts xvfb serverpyvista.start_xvfb() and also: gpv.plot_3d(geo_model, image=True, plotter_type='basic') hopefully, you may be able to see the image, but it works! merci beucoup |
Hi Is there another method to plot the topography 3d block? Adding topography gp.set_topography_from_random( gp.compute_model(geo_model) gpv.plot_3d( /user/env/lib/python3.10/site-packages/gempy_viewer/API/_plot_2d_API.py:174: UserWarning: Matplotlib is currently using module://matplotlib_inline.backend_inline, which is a non-GUI backend, so cannot show the figure. |
Hi, I am new to Gempy and recently installed the Gempy v3 issue. I am now going through the tutorials. Gempy is loaded onto my son's server overseas, while I live in SA.
So far, I have looked at the getting started module and Ch1-1.
On both occasions, I just cannot get the gempy-viewer (gpv) 3d to work. It keeps on resetting the kernel and it says gpv-3d is 'undefined'. I have installed vtk and it still does not work. Please can someone tell me how to fix it? It seems to be a common problem, well reported?
Thanks Mike
The text was updated successfully, but these errors were encountered: