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

charts not showing up in Visual Studio Code notebook #67

Closed
mschmill opened this issue Jun 3, 2021 · 4 comments
Closed

charts not showing up in Visual Studio Code notebook #67

mschmill opened this issue Jun 3, 2021 · 4 comments

Comments

@mschmill
Copy link

mschmill commented Jun 3, 2021

I am trying basically to reproduce the PyData Berlin environment using human-learn with sentence embeddings and UMAP so that I can draw boundaries, explore, and quickly label text data.

The problem I am having is that the human-learn charts are not rendering in the VSC notebook. VSC is using Jupyter for the notebook and I am on Windows. I can render Pyplot, Seaborn, even Bokeh into the notebooks but the human-learn charts do not display:

image

Is anyone else having this issue? Is there some Jupyter extension I need or some Jupyter command I need to run?
Bokeh is 2.3.2, human-learn is 0.3.1

@koaning
Copy link
Owner

koaning commented Jul 12, 2021

I think this is related to a bokeh issue. There's a similar problem on Google's colab environment.

You can confirm that this issue doesn't occur on JupyterLab from the browser?

@koaning
Copy link
Owner

koaning commented Jul 12, 2021

I'm curious if it's related to this bokeh issue.

@koaning
Copy link
Owner

koaning commented Sep 9, 2021

Closing due to radio silence.

@nthomsencph
Copy link
Contributor

nthomsencph commented Oct 6, 2021

A hacky fix to get around this is to get the hash for your VSC session and then set that as an environment variable. To get the hash string you can simply provoke the error and then you can see it as the value suggested from BOKEH_ALLOW_WS_ORIGIN=<...> as below.

ERROR:bokeh.server.views.ws:Refusing websocket connection from Origin 'vscode-webview://013b0305-284d-4b85-a635-db4846bb34ba';                       use --allow-websocket-origin=013b0305-284d-4b85-a635-db4846bb34ca or set BOKEH_ALLOW_WS_ORIGIN=**013b0305-284d-4b85-a635-db4846bb34ca** to permit this; currently we allow origins {'localhost:8889'}
WARNING:tornado.access:403 GET /ws?id=013b0305-284d-4b85-a635-db4846bb34ba&swVersion=2&extensionId=&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-webview.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&purpose=notebookRenderer (::1) 1.29ms

Then just import os and set the string as below.

import os
os["BOKEH_ALLOW_WS_ORIGIN"]="013b0305-284d-4b85-a635-db4846bb34ca"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants