# Jupyter Lab JSON error saving notebook

**URL:** <https://community.plotly.com/t/jupyter-lab-json-error-saving-notebook/13555>\
**Category:** 📊 Plotly Python\
**Created:** [September 13, 2018, 5:05pm UTC](https://community.plotly.com/t/jupyter-lab-json-error-saving-notebook/13555 "2018-09-13T17:05:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmoille](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@gmoille](https://community.plotly.com/u/gmoille)\
**Post date:** [September 13, 2018, 5:05pm UTC](https://community.plotly.com/t/jupyter-lab-json-error-saving-notebook/13555/1 "2018-09-13T17:05:34Z")

</div>

Hi guys,

I am trying to use Plotly offline with Jupyter lab and the [Jupyter lab extension](https://github.com/jupyterlab/jupyter-renderers/tree/master/packages/plotly-extension). Everything is smooth and works fine until I save the notebook, where it seems that the plot causes an issue in the overall Json of the notebook. I can run into the issue with the simple example:

> from plotly.offline import download\_plotlyjs, init\_notebook\_mode, plot, iplot  
> init\_notebook\_mode(connected=True)  
> iplot([{“x”: [1, 2, 3], “y”: [3, 1, 6]}])

In the shell I can see the error:

> Notebook JSON is invalid: {‘x’: [1, 2, 3], ‘y’: [3, 1, 6], ‘type’: ‘scatter’, ‘uid’: ‘22e994e2-b776-11e8-800b-8c8590492a0e’} is not valid under any of the given schemas
> 
> Failed validating ‘oneOf’ in display\_data[‘properties’][‘data’][‘additionalProperties’]:
> 
> On instance[‘cells’][0][‘outputs’][1][‘data’][‘0’]:  
> {‘type’: ‘scatter’,  
> ‘uid’: ‘22e994e2-b776-11e8-800b-8c8590492a0e’,  
> ‘x’: [1, 2, 3],  
> ‘y’: [3, 1, 6]}

It does not prevent the notebook to be saved. However if one reopen the notebook, the plot is now some fixed image, some type of png is inserted in the data section of the JSON instead of the html code.

Using the regular jupyter notebook however seems to work quite well (saving a reloading notebook with offline Plotly inside)

Does anyone already run into this issue? Is there a way to fix it?

Thanks!

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [September 14, 2018, 10:23am UTC](https://community.plotly.com/t/jupyter-lab-json-error-saving-notebook/13555/2 "2018-09-14T10:23:31Z")

</div>

Hi @gmoille, I see what you mean. Based on the error message I’m guessing that there’s some kind of name conflict going on.

Could you open an issue in the repo for the JupyterLab extension. This extension has been maintained by some of the Jupyter folks, and I’m hoping they’ll have some more insight into what this error message means.

Thanks!  
-Jon

---

<div class="post-metadata">

**Author:** ![gmoille](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@gmoille](https://community.plotly.com/u/gmoille)\
**Post date:** [September 14, 2018, 12:58pm UTC](https://community.plotly.com/t/jupyter-lab-json-error-saving-notebook/13555/3 "2018-09-14T12:58:33Z")

</div>

Hi Jon,

Thank you for the answer. For the record, I opened an issue in the renderers JupyterLab extension repo on GitHub [https://github.com/jupyterlab/jupyter-renderers/issues/158](https://github.com/jupyterlab/jupyter-renderers/issues/158)
