Python Interactive session hangs when running k3d polt cell (IPyWidget problem)
See original GitHub issueEnvironment data
- VS Code version: 1.34.0
- Extension version (available under the Extensions sidebar): 2019.5.17517
- OS and version: Windows 10.0.16299
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions: K3D 2.6.5, Jupyter Notebook 5.7.8
Expected behaviour
Entering the following python code in an empty .py file in vscode, and clicking the “Run Cell” code lens should launch the Python Interactive session, run the code, and display the output as a 3D plot that you can interact with.
Or, at worst, display a message that the output format is not supported if that is the case.
#%%
import k3d
plot = k3d.plot()
vertices = [[0, 0, 0], [0, 0, 1], [1, 0, 0]]
indices = [[0, 1, 2]]
mesh = k3d.mesh(vertices, indices)
plot += mesh
plot.display()
Actual behaviour
Python Interactive session is created, the Jupyter server is running, the code cell appears and it looks like it is running (moving wait indicator thingy animates) but it looks like the server never returns, and vscode never times out. The indicator just keeps animating.
While this is happening it is possible to connect to the same Jupyter server (cut and paste the URL from vscode into a browser window) and run the code in an interactive session there. In the browser, the code runs and displays the plot almost instantly, meanwhile vscode remains hung.
Steps to reproduce:
- Ensure that jupyter and k3d-jupyter are installed (for k3d see installation section here: https://github.com/K3D-tools/K3D-jupyter it’s in pip and conda).
- Create a new empty .py file
- Cut and paste the python code above
- Click the Run Cell code lense
Logs
Jupyter Server URI: http://localhost:8889/?token=99e4d40e2669837d10c9e27cc1dc7e3e2cc72d06b0f523b9
Python version:
3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
C:\\Python37\\python.exe
Jupyter Notebook Version: (5, 7, 8)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Number 2. We don’t currently support any ipywidgets.
@greazer I don’t think it’s an exact dupe. The issue is not just supporting ipywidgets, but that in the case of this issue Python Interactive hangs. Other ipywidgets do not exhibit this behavior, for example pythreejs just doesn’t output anything, or outputs the textual representation of the output, which is what you’d expect. I described that behavior in more detail here: https://github.com/K3D-tools/K3D-jupyter/issues/157#issuecomment-498627114