Skip to content

Commit d27686e

Browse files
more troubleshooting docs
1 parent c0c4424 commit d27686e

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

doc/python/renderers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ This renderer may be useful when working with notebooks than contain lots of lar
158158
The `plotly_mimetype` renderer creates a specification of the figure (called a MIME-type bundle), and requests that the current user interface displays it. User interfaces that support this renderer include [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) (requires the [`jupyterlab-plotly`](https://www.npmjs.com/package/jupyterlab-plotly) extension), [nteract](https://nteract.io/), and the Visual Studio Code [notebook interface](https://code.visualstudio.com/docs/python/jupyter-support).
159159

160160
###### `jupyterlab`, `nteract`, and `vscode`
161-
These are aliases for `plotly_mimetype` since this renderer is a good choice when working in JupyterLab, nteract, and the Visual Studio Code notebook interface.
161+
These are aliases for `plotly_mimetype` since this renderer is a good choice when working in JupyterLab, nteract, and the Visual Studio Code notebook interface. Note that in VSCode Notebooks, the version of Plotly.js that is used to render is provided by the [vscode-python extension](https://code.visualstudio.com/docs/languages/python) and often trails the latest version by several weeks, so the latest features of `plotly` may not be available in VSCode right away. The situation is similar for Nteract.
162162

163163
##### Static Image Renderers
164164
A set of renderers is provided for displaying figures as static images. These renderers all rely on the [orca](https://github.com/plotly/orca) static image export utility. See the [Static Image Export](https://plot.ly/python/static-image-export/) page for more information on getting set up with [orca].

doc/python/troubleshooting.md

+22-7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ $ conda uninstall plotly
4848
$ pip remove plotly
4949
```
5050

51+
### Dash Problems
52+
53+
If you are encountering problems using `plotly` with [Dash](https://dash.plotly.com/) please first ensure that you have upgraded `dash` to the latest version, which will automatically upgrade `dash-core-components` to the latest version, ensuring that Dash is using an up-to-date version of the Plotly.js rendering engine for `plotly`. If this does not resolve your issue, please visit our [Dash Community Forum](https://community.plotly.com/) and we will be glad to help you out.
54+
5155
### Jupyter Notebook Classic Problems
5256

5357
The classic Jupyter Notebook (i.e. launched with `jupyter notebook`) sometimes suffers from a problem whereby if you close the window and reopen it, your plots render as blank spaces.
@@ -65,24 +69,30 @@ As a last resort, you can "Restart & Clear Output" from the Kernel menu and reru
6569

6670
### JupyterLab Problems
6771

68-
In order to use `plotly` in JupyterLab, you *must have the extensions installed* as detailed in the [Getting Started guide](/python/getting-started). Please note that the *extension version matters*: the extension versions in the [Getting Started](/python/getting-started) guide match the version of `plotly` at the top of the guide and so they should be installed together. Note also that these extensions are meant to work with JupyterLab 1.x and not 0.x.
69-
70-
If you are having problems in JupyterLab, a good first step is to check that you have the extensions installed by running uninstall/reinstall the extensions.
72+
In order to use `plotly` in JupyterLab, you *must have the extensions installed* as detailed in the [Getting Started guide](/python/getting-started). There are two extensions: `jupyterlab-plotly` for rendering figures with `fig.show()` and `plotlywidget` for the `FigureWidget`. Please note that the *extension version matters*: the extension versions in the [Getting Started](/python/getting-started) guide match the version of `plotly` at the top of the guide and so they should be installed together. Note also that these extensions are meant to work with JupyterLab 1.x and 2.x but not 0.x.
7173

72-
To list your current extensions, run the following command in a terminal shell:
74+
To list your current extensions, run the following command in a terminal shell **from the same environment as JupyterLab was launched**:
7375

7476
```bash
7577
$ jupyter labextension list
7678
```
7779

78-
To uninstall your Plotly extensions, run the following commands in a terminal shell before reinstalling them by following the instructions in the [Getting Started guide](/python/getting-started):
80+
Depending on your setup, it's possible for the command above to list the correct extensions but for them not to be loaded in the JupyterLab front-end you have loaded in your browser. To check if this is the problem, you can [look at the active extension list through your browser via the JupyterLab Extension Manager](https://jupyterlab.readthedocs.io/en/stable/user/extensions.html#using-the-extension-manager). This is important notably when you have per-kernel environments, or when you are using a centrally-hosted installation of JupyterLab. In such situations, `jupyter labextension list` may indicate that the extension is installed in a given environment, but it doesn't get loaded in your browser because JupyterLab is launched from a different environment.
81+
82+
If you have the correct version of the extensions installed and active in your active JupyterLab sessions and are still seeing problems, the issue may clear up if you rebuild JupyterLab. This shouldn't be required in principle but many users have resolved their issues this way. To rebuild JupyterLab, shut down JupyterLab and run the following command in a terminal shell **from the same environment as JupyterLab was launched**:
83+
84+
```bash
85+
$ jupyter lab build
86+
```
87+
88+
To uninstall your Plotly extensions prior to reinstalling them, run the following commands in a terminal shell before reinstalling them by following the instructions in the [Getting Started guide](/python/getting-started):
7989

8090
```bash
8191
$ jupyter labextension uninstall jupyterlab-plotly
8292
$ jupyter labextension uninstall plotlywidget
8393
```
8494

85-
If you run into "out of memory" problems while installing the extensions, try running these commands before running `jupyter labextension install`...
95+
If you run into "out of memory" problems while installing the extensions or building JupyterLab, try running these commands before running `jupyter labextension install`...
8696

8797
```bash
8898
# Avoid "JavaScript heap out of memory" errors during extension installation
@@ -104,6 +114,11 @@ set NODE_OPTIONS=
104114

105115
<!-- #endregion -->
106116

117+
### VSCode Notebook, Nteract and Streamlit Problems
118+
119+
Plotly figures render in VSCode using a Plotly.js version bundled with the [vscode-python extension](https://code.visualstudio.com/docs/languages/python), and unfortunately it's often a little out of date compared to the latest version of the `plotly` module, so the very latest features may not work until the following release of the vscode-python extension. In any case, regularly upgrading your vscode-python extension to the latest version will ensure you have access to the greatest number of recent features.
120+
121+
The situation is similar for environments like Nteract and Streamlit: in these environments you will need a version of these projects that bundles a version Plotly.js that supports the features in the version of `plotly` that you are running.
107122

108123
### Orca Problems
109124

@@ -112,4 +127,4 @@ set NODE_OPTIONS=
112127
113128
If you get an error message stating that the `orca` executable that was found is not valid, this may be because another executable with the same name was found on your system. Please specify the complete path to the Plotly-Orca binary that you downloaded (for instance in the Miniconda folder) with the following command:
114129

115-
`plotly.io.orca.config.executable = '/home/your_name/miniconda3/bin/orca'`
130+
`plotly.io.orca.config.executable = '/home/your_name/miniconda3/bin/orca'`

0 commit comments

Comments
 (0)