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
WebGL error #25
Comments
Pls ignore "render_mode", I was trying that out to see if it did anything. |
Hi @miglto Let's check if your problem is related to import pandas as pd
import plotly.express as px
df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')
fig.show(renderer="browser") It should open a Plotly figure in your browser that looks like mine above |
That works fine.
However, this is rendered in Safari. Does the pandasgui window use some other engine?
… On Aug 18, 2020, at 4:31 PM, Adam ***@***.***> wrote:
Hi @miglto <https://github.com/miglto>
It works for me:
<https://user-images.githubusercontent.com/10884874/90562284-f10cf880-e16f-11ea-8c99-36c168d86e49.png>
Let's check if your problem is related to pandasgui or just plotly. Can you run the code below and let me know what happens?
import pandas as pd
import plotly.express as px
df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')
fig.show(renderer="browser")
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMLDVNFGVHP6FPWXTMT3RHLSBLQL5ANCNFSM4QD6KCBA>.
|
Yeah Can you try this code now? from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView
import tempfile
import pandas as pd
import plotly.express as px
from plotly.io import to_html
df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])
file = tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False)
file.write(to_html(fig, config={"responsive": True}))
viewer = QWebEngineView()
viewer.load(QtCore.QUrl.fromLocalFile(file.name))
viewer.show()
app.exec_() |
Done. Get the WebGL error:
… On Aug 18, 2020, at 4:50 PM, Adam ***@***.***> wrote:
Yeah pandasgui uses the QWebEngineView from PyQt.
Can you try this code now?
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView
import tempfile
import pandas as pd
import plotly.express as px
from plotly.io import to_html
df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])
file = tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False)
file.write(to_html(fig, config={"responsive": True}))
viewer = QWebEngineView()
viewer.load(QtCore.QUrl.fromLocalFile(file.name))
viewer.show()
app.exec_()
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMLDVNEH5F6EL3MYGQZXWJTSBLSPTANCNFSM4QD6KCBA>.
|
Simple example that fails below - this is a QtWebEngine issue... Who to ask? from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([]) viewer = QtWebEngineWidgets.QWebEngineView() app.exec_() |
Posted to the Qt forum:
https://forum.qt.io/topic/118171/webgl-error-on-mac
… On Aug 18, 2020, at 4:50 PM, Adam ***@***.***> wrote:
Yeah pandasgui uses the QWebEngineView from PyQt.
Can you try this code now?
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView
import tempfile
import pandas as pd
import plotly.express as px
from plotly.io import to_html
df = pd.read_csv('https://drive.google.com/u/0/uc?id=1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz')
fig = px.scatter(data_frame=df, x='bid', y='ask')
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication([])
file = tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False)
file.write(to_html(fig, config={"responsive": True}))
viewer = QWebEngineView()
viewer.load(QtCore.QUrl.fromLocalFile(file.name))
viewer.show()
app.exec_()
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMLDVNEH5F6EL3MYGQZXWJTSBLSPTANCNFSM4QD6KCBA>.
|
Yep looks like a from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
app = QtWidgets.QApplication(["--ignore-gpu-blacklist", "--enable-gpu-rasterization"])
viewer = QtWebEngineWidgets.QWebEngineView()
viewer.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True)
viewer.load(QtCore.QUrl("http://webglreport.com/?v=2"))
viewer.show()
app.exec_()
If none of the above works, try also posting on https://stackoverflow.com/ with the Also include what OS version you're using and your version of |
That did not work. I have the latest of PyQt5 and PyQtWebEngine (looks to be version 12.8.0 according to pip).
Miguel
… On Aug 18, 2020, at 8:18 PM, Adam ***@***.***> wrote:
Yep looks like a QWebEngineView issue. I found a few potential fixes... try the snippet below. And if it doesn't work, also try upgrading PyQt5 and PyQtWebEngine to latest versions or at least 5.13.0
from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
app = QtWidgets.QApplication(["--ignore-gpu-blacklist", "--enable-gpu-rasterization"])
viewer = QtWebEngineWidgets.QWebEngineView()
viewer.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True)
viewer.load(QtCore.QUrl("http://webglreport.com/?v=2"))
viewer.show()
app.exec_()
Who to ask?
If none of the above works, try also posting on https://stackoverflow.com/ <https://stackoverflow.com/> with the pyqt and pyqt5 tags.
Also include what OS you're using and your version of PyQt5 and PyQtWebEngine
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMLDVNHCOVYHKHR3ZN66MY3SBMK5RANCNFSM4QD6KCBA>.
|
PyQt5 and PyQtWebEngine are versions 5.15.0 (latest) |
I installed Ubuntu 20.04 on my mac, and the webgl error is gone. I am guessing this is macos blocking a call to webgl. It is odd that it would do that but it works in Safari, Chrome, and Firefox. |
Yeah unfortunately I can't be much help debugging since I can't reproduce the issue myself (don't have a Mac), but if you do end up finding a solution I'll add the fix to |
Yes, I will let you know if I find a solution. However, frankly now that I got my mac to triple-boot (macos, ubuntu, windows) I will probably not bother with macos for this any longer... :) BTW... Quick question: Would it be possible/useful to add a filter to pandasgui? Meaning for example selecting rows based on some value of the row. Obviously this can be done in code, but that's a tad slower. Thx! |
Yup I'll probably focus on that now since I'm mostly done the Grapher. If you have any ideas about how it should look & work feel free to post. I'll probably start off by just providing a text input on each DataFrame that lets you enter strings as a Pandas query expression, and allow you to toggle them on/off. Also considered a button on each header that pops up a UI like this, but its more work and not that much better so I'll put it off for someone else to do or until I have more time |
That's cool. A few comments:
|
BTW... I was COMPLETELY shocked by the change in the Grapher layout. I was like "I must have broken something". Once I figured how it works, it's clearly an improvement. |
ftr, I have the same issue in Ubuntu 18.04 |
I recommend trying the same snippet as miglto:
And that will narrow it down to a PyQt5 issue, and then I recommend opening a thread here https://forum.qt.io/category/10/general-and-desktop If someone has a solution that can be solved with code let me know and I'll put it in PandasGUI. |
For me it turned out to be an issue with PyCharm. It works nicely from the ipython commandline. |
When trying to plot a dataframe on Mac (python 3.8, latest pandasgui from this repository), I am getting an error saying webgl is not available. I checked all browsers I have and they all support webgl (meaning when I go to the webgl site, I can see the graph - it is possible this is webgl2 not 1).
The dataset I used is here:
https://drive.google.com/file/d/1qlUt1_X_0BxbmFDP5YgAqIQBp3osP4jz/view?usp=sharing
The text was updated successfully, but these errors were encountered: