question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

- WebGL is not supported by your browser - for scatter, line, scatter3d plots

See original GitHub issue

PLEASE FILL OUT THE TEMPLATE

Hello, thank you for this amazing app, it is really helpful.

Describe the bug

Some plots works and other don’t. Histogram is fine, as well as Contour and Heatmap.

But the two main ones that I want to use (scatter, line) don’t work and shows a message in the GUI when I click on the “Finish” button :

" WebGL is not supported by your browser - visit https://get.webgl.org for more info"

I think (not 100% sure) that i remember these types of plots were working like a week or two ago, but nothing really changed in my code since (no pip packages upgraded)

The python console says WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.

each first time I use the function show() from pandasgui. I think this message is related to the issue but I have no idea how to fix it.

Environment OS: Mint 20 cinnamon Python: 3.8.5 conda virtual envrionment IDE: VsCode python interactive console by copy/pasting the code, OR by running the python script, same issue

Package versions

All packages installed : (collapsable content)

absl-py 0.10.0 aiodns 1.1.1 aiohttp 3.7.2 aiohttp-socks 0.5.5 aiorpcX 0.18.4 alabaster 0.7.12 analytics-python 1.2.9 ansi2html 1.5.2 appdirs 1.4.4 arbitragelab 0.1.0 argh 0.26.2 argon2-cffi 20.1.0 astroid 2.4.2 astunparse 1.6.3 async-generator 1.10 async-timeout 3.0.1 atomicwrites 1.4.0 attrs 20.2.0 autopep8 1.5.4 Babel 2.8.0 backcall 0.2.0 bitstring 3.1.7 bleach 3.2.1 bokeh 2.2.1 Bottleneck 1.3.2 Brotli 1.0.9 brotlipy 0.7.0 cachetools 4.1.1 ccxt 1.35.22 certifi 2020.12.5 cffi 1.14.3 chardet 3.0.4 click 7.1.2 cloudpickle 1.6.0 cryptography 3.1.1 cvxpy 1.1.1 cycler 0.10.0 Cython 3.0a6 dacite 1.6.0 dash 1.14.0 dash-bootstrap-components 0.10.3 dash-core-components 1.10.2 dash-cytoscape 0.2.0 dash-html-components 1.0.3 dash-renderer 1.6.0 dash-table 4.9.0 dask 2.28.0 decorator 4.4.2 defusedxml 0.6.0 diff-match-patch 20200713 distlib 0.3.1 distributed 2.28.0 dnspython 1.16.0 docutils 0.16 ecdsa 0.16.0 ecos 2.0.7.post1 Electrum 4.0.4 entrypoints 0.3 evdev 1.3.0 faster-than-csv 1.8 filelock 3.0.12 flake8 3.8.3 Flask 1.1.2 Flask-Compress 1.5.0 fsspec 0.8.3 future 0.18.2 gast 0.3.3 google-auth 1.21.3 google-auth-oauthlib 0.4.1 google-pasta 0.2.0 grpcio 1.32.0 h5py 2.10.0 HeapDict 1.0.1 helpdev 0.7.1 idna 2.10 imagesize 1.2.0 importlib-metadata 1.7.0 iniconfig 1.1.1 intervaltree 3.1.0 ipykernel 5.3.4 ipython 7.18.1 ipython-genutils 0.2.0 isort 5.5.4 itsdangerous 1.1.0 jedi 0.17.1 jeepney 0.4.3 Jinja2 2.11.2 joblib 0.16.0 json5 0.9.5 jsonschema 3.2.0 jupyter-client 6.1.7 jupyter-core 4.6.3 jupyter-dash 0.3.1 jupyter-kite 1.1.0 jupyterlab 2.2.9 jupyterlab-pygments 0.1.2 jupyterlab-server 1.2.0 Keras-Preprocessing 1.1.2 keyring 21.4.0 kiwisolver 1.2.0 lazy-object-proxy 1.4.3 lightgbm 3.1.1 llvmlite 0.32.1 locket 0.2.0 Markdown 3.2.2 MarkupSafe 1.1.1 matplotlib 3.2.1 mccabe 0.6.1 mistune 0.8.4 msgpack 1.0.0 multidict 5.0.0 nbclient 0.5.0 nbconvert 6.0.6 nbformat 5.0.7 nest-asyncio 1.4.1 networkx 2.4 notebook 6.1.4 numba 0.49.1 numpy 1.18.5 numpydoc 1.1.0 oauthlib 3.1.0 opt-einsum 3.3.0 osqp 0.6.1 packaging 20.4 pandas 1.0.4 pandasgui 0.2.7 pandocfilters 1.4.2 parso 0.7.0 partd 1.1.0 pathtools 0.1.2 patsy 0.5.1 pbr 5.5.1 pexpect 4.8.0 pickleshare 0.7.5 Pillow 7.2.0 pip 20.2.3 plotly 4.10.0 pluggy 0.13.1 postgres-binary-parser 0.0.0 POT 0.7.0 prometheus-client 0.8.0 prompt-toolkit 3.0.7 protobuf 3.13.0 psutil 5.7.2 psycopg2 2.8.6 ptyprocess 0.6.0 py 1.9.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycares 3.1.1 pycodestyle 2.6.0 pycparser 2.20 pydocstyle 5.1.1 pyflakes 2.2.0 Pygments 2.7.1 pylint 2.6.0 pynput 1.7.1 pyOpenSSL 19.1.0 pyparsing 2.4.7 PyQt5 5.15.2 PyQt5-sip 12.8.1 PyQtWebEngine 5.15.2 pyrsistent 0.17.3 PySocks 1.7.1 pytest 6.1.1 python-dateutil 2.8.1 python-jsonrpc-server 0.4.0 python-language-server 0.35.1 python-socks 1.1.0 python-xlib 0.29 pytz 2020.1 pyxdg 0.26 PyYAML 5.3.1 pyzmq 19.0.2 QDarkStyle 2.8.1 qrcode 6.1 QtAwesome 0.7.2 qtconsole 4.7.7 QtPy 1.9.0 requests 2.24.0 requests-oauthlib 1.3.0 retrying 1.3.3 rope 0.17.0 rsa 4.6 Rtree 0.9.4 scikit-learn 0.23.1 scipy 1.5.4 scs 2.1.2 SecretStorage 3.1.2 Send2Trash 1.5.0 setuptools 50.3.0 sip 4.19.13 six 1.15.0 snowballstemmer 2.0.0 sortedcontainers 2.2.2 Sphinx 3.2.1 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 1.0.3 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.4 spyder 4.1.5 spyder-kernels 1.9.4 SQLAlchemy 1.3.19 statsmodels 0.11.1 stevedore 3.3.0 tblib 1.7.0 tensorboard 2.2.2 tensorboard-plugin-wit 1.7.0 tensorflow 2.2.0 tensorflow-estimator 2.2.0 termcolor 1.1.0 terminado 0.8.3 testpath 0.4.4 threadpoolctl 2.1.0 toml 0.10.1 toolz 0.11.1 tornado 6.0.4 traitlets 5.0.4 typing-extensions 3.7.4.3 ujson 3.2.0 urllib3 1.25.10 virtualenv 20.2.2 virtualenv-clone 0.5.4 virtualenvwrapper 4.8.4 watchdog 0.10.3 wcwidth 0.2.5 webencodings 0.5.1 Werkzeug 1.0.1 wheel 0.35.1 wrapt 1.11.2 wurlitzer 2.0.1 yapf 0.30.0 yarl 1.6.2 zict 2.0.0 zipp 3.1.0

console.log("I'm a code block!");

Any help would be much appreciated. I did read this related issue but didn’t find any fix for my case there https://github.com/adamerose/pandasgui/issues/25

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adamerosecommented, Jan 5, 2021

All right so here’s new insights :

from pandasgui import show
from pandasgui.datasets import pokemon
show(pokemon)

gives no problem on a blank script. This was indeed a problem with my original script. I found the issue so here is some reproducible code :

import pandas as pd 
# from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets # uncomment this line to fix the scattter plot issue

db=pd.read_csv('testfull') # only 'testfull' file gives the error, 'test' which is only a 4 row dataframe is not giving any error
import matplotlib.pyplot as plt

a=db.close+10
a.plot(legend=True)
b=db.close+20
b.plot(legend=True)
a=db.close+30
a.plot(legend=True)
a=db.close+50
a.plot(legend=True)
db.close.plot(secondary_y=True,legend=True)
plt.show()

from pandasgui import show
show(db) 

I uploaded two text files which are dataframes. The one named " test " is a very small and doesn’t give the issue. The bigger version " testfull " has the WebGl error.

Thanks, this example gives the same error on my Windows 10 machine so I can debug.

Obviously this has to do with conflicts with matplolib. If you remove all the .plot() parts, pandasgui is working fine. But it’s strange that importing Qt packages before fixes this anyway.

I suspect it might be related to this workaround where I temporarily kill the QApplication created by matplotlib’s backend to allow importing QtWebEngineWidgets. It’s supposed to warn you when this happens but I just noticed a problem with the logger so this didn’t happen (that’s fixed on the dev branch now).

The workaround seems to work fine in simple cases like below, but it breaks WebGL when it kills the QApplication created by matplotlib. I’ll see if that can be fixed

from PyQt5 import QtWidgets
app = QtWidgets.QApplication([])
from pandasgui import show
from pandasgui.datasets import pokemon
show(pokemon)
0reactions
adamerosecommented, Jan 7, 2021

I think I found a fix here, interestingly just attempting to run from PyQt5 import QtWebEngineWidgets with an existing QApplication breaks OpenGL even inside a try/catch. So my workaround now uses if statements instead of try/catch, and your example works for me now. Let me know it doesn’t for you (test the latest version with pip install git+https://github.com/adamerose/pandasgui.git)

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebGL is not supported by your browser for 3d Scatter - plotly.js
I'm getting a “WebGL is not supported by your browser” error message, even though your test page displays fine and I also see...
Read more >
JupyterLab: WebGL is not supported by your browser
I got this problem when I tried to set the width of the plotly express line graph to a very high value. Restarting...
Read more >
WebGL is not supported by your browser - KNIME Server
Hi there, We have a few WebPortal models which enable the view of 3D Scatter plots which are created using the Generic Java...
Read more >
WebGL is not supported by your browser - Plotly - RStudio IDE
Hi, Since this morning I am not able to generate 3D charts with plotly package. On the Viewer window I get the message:...
Read more >
A complete guide to 3D visualization device system in R - Wiki
The function rgl.points() is used to draw a 3D scatter plot: ... The values x2, y2 and y3 corresponds to the 3D coordinates...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found