gempy
gempy copied to clipboard
kernel issue when plot3d
Describe the bug When running gempy on Jupyter notebook , it doesn't plot 3d or 2d plot somehow. I have tried the same code on MS EDGE, Mozilla, and Chrome but issue is still the same could suggest my to resolve this issue.
To Reproduce I have attached the screenshot of the issue.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
Desktop (please complete the following information):
- OS: (e.g. iOS) - Windows
- GemPy Version 2.2.8
- if installed via pip: provide GemPy version (e.g. 2.0.1)
- if cloned from GitHub: provide Git commit id (e.g. 839bf85f)
- Jupyter Version (if applicable) 3.7.8
Additional context Add any other context about the problem @here.
Hi @chandpes
the 3D plot should open in a python window outside of your jupyter notebook. From the screenshot you provided, I cannot diagnose any error. For the plot_2d, did you add a magic function for matplotlib to plot in the notebook, e.g. %matplotlib inline
?
Best Jan
Hi Jan, Yes, I have added %matplotlib inline Still it doesn’t work.
Thanks & regards Subhash Chandra
On 9 Mar 2022, at 2:38 am, Jan Niederau @.***> wrote:
Hi @chandpes
the 3D plot should open in a python window outside of your jupyter notebook. From the screenshot you provided, I cannot diagnose any error. For the plot_2d, did you add a magic function for matplotlib to plot in the notebook, e.g. %matplotlib inline ?
Best Jan
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.
Hi @chandpes without further information, I cannot diagnose any error, as your screenshot does not show an error at all.
I'm trying to run this example and it happens with me too. Kernel dies after running plot_2d
function, and then can't run plot_3d
.
This is the output after trying plot_2d
I have imported all these libraries, including %matplotlib inline
import gempy as gp
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
np.random.seed(1515)
pd.set_option('precision',2)
%matplotlib inline
Desktop (please complete the following information):
- OS: (e.g. iOS) - Pop OS 21.10 (Linux - Ubuntu based)
- GemPy Version 2.2.10 installed via pip
- Jupyter Version (if applicable) 3.2.4
I ran the tutorial in the python shell, and I had the same error after plotting the 2D image. The message was this:
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: não é possível abrir arquivo compartilhado: Arquivo ou diretório inexistente (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
2022-03-11 17:40:45.959 ( 3,022s) [ 11FA3300]vtkXOpenGLRenderWindow.:651 ERR| vtkXOpenGLRenderWindow (0x55568290e930): Cannot create GLX context. Aborting.
ERROR:root:Cannot create GLX context. Aborting.
Fatal Python error: Aborted
Current thread 0x00007f0911fa3300 (most recent call first):
File "/home/rodrigo/anaconda3/envs/geospatial/lib/python3.8/site-packages/pyvista/plotting/plotting.py", line 1192 in render
File "/home/rodrigo/anaconda3/envs/geospatial/lib/python3.8/site-packages/pyvista/plotting/plotting.py", line 4844 in show
File "/home/rodrigo/anaconda3/envs/geospatial/lib/python3.8/site-packages/gempy/plot/plot_api.py", line 353 in plot_3d
File "geomodel.py", line 53 in <module>
Abortado (imagem do núcleo gravada)
@rodreras can you check if pyvista is working and you're able to visualize one of their examples? To me, it currently looks like a libgl problem in your case.
Hi @rodreras Are there any updates? did you try running pyvista?
Hi @rodreras Are there any updates? did you try running pyvista?
Hey! I was out on a field work. Today as soon as I get back to the office I'll try running it.
I have the same issue here running the Docker image (leguark/gempy). I would love to get started with this beautiful package ;-)
Do you also get the GLX error @snakesonabrain ?
@rodreras any progress with running PyVista examples ?
Do you also get the GLX error @snakesonabrain ?
@rodreras any progress with running PyVista examples ?
No, just a Kernel Died dialog
Do you also get the GLX error @snakesonabrain ?
@rodreras any progress with running PyVista examples ?
I'm on my way back to the office right now. I'm going to try installing in a separated environment. I think you might be right about the pyvista lib. Last week I tried running the examples, but I had issues.
Do you also get the GLX error @snakesonabrain ? @rodreras any progress with running PyVista examples ?
No, just a Kernel Died dialog
Does 2D plotting work, or does the kernel also die using 2d plots?
Do you also get the GLX error @snakesonabrain ? @rodreras any progress with running PyVista examples ?
No, just a Kernel Died dialog
Does 2D plotting work, or does the kernel also die using 2d plots?
Just the 3D, 2D plots work just fine
@snakesonabrain thanks for the quick reply.
Do you run your model code in a notebook? If so, and if you use the magic function %matplotlib inline
in the beginning, could you change that to %matplotlib qt5
and see, if the kernel/notebook survives that or dies after you run the cell?
I am running notebooks. When I use the %matplotlib qt5
command, I get another error: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running
I am running notebooks. When I use the
%matplotlib qt5
command, I get another error: Cannot load backend 'Qt5Agg' which requires the 'qt5' interactive framework, as 'headless' is currently running
Alright, then in your case this could be the source of error. We need qt5, i.e. pyqt5 for the 3D plots.
In case you run it on windows and use conda, you could use this yml to create an environment which should work for gempy https://github.com/Japhiolite/environments/blob/master/environment_gempy_windows.yml
Tried to create the conda environment from the .yml file on both Mac and Windows but got errors during the Theano function compilation on both platforms. On Windows, the error message is this:
Error: invalid register for .seh_savexmm\r. ', '[Elemwise{lt,no_inplace}(<TensorType(float64, matrix)>, <TensorType(float64, (True, True))>)]
The idea of working with Docker images is probably a more robust solution but then the issue with plotting using the pyqt5 backend needs to be resolved.
I assume, your theano installation isn't working as intended.
In your conda environment, make sure to have installed theano via conda on windows.
Theano requires a couple of other libraries. From the theano installation:
conda install numpy scipy mkl-service libpython <m2w64-toolchain> pytest <sphinx> <pydot-ng> <git>