I have those versions installed:
# I downgraded to 4.0.3 but same error
jupyter-lab --version
4.0.5
Name: plotly
Version: 5.15.0
this is the sample code. it plots on vscode but it does not run on jupyter-lab
import chart_studio.plotly as py
import plotly.graph_objs as go
import plotly.express as px
from plotly.offline import download_plotlyjs , init_notebook_mode , plot, iplot
# this is needed in jupyter
init_notebook_mode(connected=True)
px.box(x=[1,2,3,4] , y=[1,4,9,16] )
plotly
requires a browser environment to run. I googled the plotly-jupyter issue and none of the solutions worked. I tried with jupyter notebook
as well but it did not work. So I open Chrome console (I tried on firefox but same error)to dive into the problem. every time I execute the plotting code, I get this error:
Uncaught ReferenceError: require is not defined
this is the source of error:
I think somehow plotly
uses javascript
but it has no access to javascript. I disabled all the extensions, restart the kernel but still same error
However, I'm stuck at this point, and I'm not sure how to go further. Can someone please provide guidance on how to proceed from here?
those are installed plugins: