Skip to content
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

Example doesn't seem to work - ReferenceError: require is not defined #38

Closed
ghuname opened this issue Mar 30, 2019 · 2 comments
Closed

Example doesn't seem to work - ReferenceError: require is not defined #38

ghuname opened this issue Mar 30, 2019 · 2 comments

Comments

@ghuname
Copy link

@ghuname ghuname commented Mar 30, 2019

Hi,

when I execute px.scatter(gapminder2007, x="gdpPercap", y="lifeExp") I got an error in browser and nothing is showed in jupyterlab, but place for graph is reserved:

ReferenceError: require is not defined[Learn More] lab line 270693 > scriptElement:1:1
(index):1
attachWidget panellayout.js:210
insertWidget panellayout.js:113
_insertOutput widget.js:335
onModelChanged widget.js:217
invokeSlot index.js:475
emit index.js:433
emit index.js:106
_onListChanged model.js:282
invokeSlot index.js:475
emit index.js:433
emit index.js:106
push observablelist.js:137
_add model.js:213
add model.js:139
_onIOPub widget.js:93
_handleIOPub future.js:212
InterpretGeneratorResume (index):1255
next (index):1210
fulfilled future.js:6

In the same notebook plotly works, for example:
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot

plot([go.Scatter(x=[1, 2, 3], y=[3, 1, 6])])

OS: Linux Manjaro
Browser: Firefox 66.0.1 (64-bit)
plotly: 3.7.1
plotly_express: plotly_express.version doesn't work, I don't know how to check
jupyterlab: 0.35.4
jupyterlab/plotly-extension: I don't know how to check version, but I have just installed it today

@ghuname

This comment has been minimized.

Copy link
Author

@ghuname ghuname commented Mar 31, 2019

Looks like I forgot to execute:

`# Avoid "JavaScript heap out of memory" errors during extension installation

(OS X/Linux)

export NODE_OPTIONS=--max-old-space-size=4096

(Windows)

set NODE_OPTIONS=--max-old-space-size=4096

Jupyter widgets extension

jupyter labextension install @jupyter-widgets/jupyterlab-manager@0.38 --no-build

FigureWidget support

jupyter labextension install plotlywidget@0.8.0 --no-build

offline iplot support

jupyter labextension install @jupyterlab/plotly-extension@0.18.2 --no-build

JupyterLab chart editor support (optional)

jupyter labextension install jupyterlab-chart-editor@1.1 --no-build

Build extensions (must be done to activate extensions since --no-build is used above)

jupyter lab build

Unset NODE_OPTIONS environment variable

(OS X/Linux)

unset NODE_OPTIONS

(Windows)

set NODE_OPTIONS=`

...as it is stated on page https://github.com/plotly/plotly.py/blob/master/README.md
in section "JupyterLab Support (Python 3.5+)"

Now everything works. I hope this information will help to someone.

@nicolaskruchten

This comment has been minimized.

Copy link
Member

@nicolaskruchten nicolaskruchten commented Apr 8, 2019

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.