-
Notifications
You must be signed in to change notification settings - Fork 18
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
Uncaught ReferenceError: Plotly is not defined #46
Comments
Can you please try running this small example to check whether Plotly works as intended? import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show() |
Yes, this works fine! |
Huh, that's strange. Can you successfully parse your log files? You can just print the pandas DataFrame or call px.line(nodelog, x="Time", y="Gap", color="Log") |
Thanks! Calling the plotly drawing method directly works :) |
OK, thanks for confirming that! I will try to reproduce the error on Databricks myself, and hopefully, I can figure out what is going wrong there. |
Hi @irisvanheck can you show us the output of the following?
|
Package Version anyio 3.5.0 |
If you run
in the first cell of the notebook, then proceed with your code in the next cell, do you still get the error? |
Unfortunately, yes: 'Uncaught ReferenceError: Plotly is not defined' |
Based on similar error threads I found around the internet I think the issue is related to the ipywidgets which are being attached to the plotly graph, and is not specific to gurobi (but let's see if we can find a way to workaround it). I haven't been able to reproduce your exact error on Databricks, however I don't get a satisfactory result either with the output containing "Loading widget. This should take less than 30 seconds." and not progressing. |
There's some databricks docs on Plotly: On the first line it says "Databricks supports Plotly 2.0.7" .... v2.0.7 was published 6 years ago. Surely this is just a case of lazy documentation. It mentions:
Any plotly keywords arguments can be passed through the via the gurobi_logtools plot function, however the underlying plot, which is needed for displayHTML, is not returned and it's not clear to me, when using ipywidgets in the manner that we are, that it can be. Are you familiar with matplotlib? That might be the quickest resolution - I've been using gurobi_logtools for 1.5 years now and have never bothered with plotly, and just used matplotlib/seaborn. |
Hi! While trying to use gurobi-logtools, I am encoutering the following error:
This is the code I'm executing in databricks:
I already tried to reinstall plotly and import plotly, but this does not solve the problem. Do you have any idea what could help? Thanks!
The text was updated successfully, but these errors were encountered: