VTK seems to break interactive window
See original GitHub issueThis example requires pip install pymatgen vtk
. VTK is the Visualization Toolkit which offers 1st party Python bindings.
# %%
from pymatgen.core import Structure
from pymatgen.vis.structure_vtk import StructureVis
# %%
struct = Structure(
[[1, 0, 0], [0, 1, 0], [0, 0, 1]],
["O", "H", "H"],
[[0, 0, 0], [0.5, 0.5, 0], [0.5, 0, 0.5]],
)
# %%
struct_vis = StructureVis()
struct_vis.set_structure(struct)
struct_vis.show()
# %%
print("hello")
Two odd things here:
-
The interactive crystal structure created by
struct_vis.show()
opens in a new Python window, i.e. is not captured by VS Code Jupyter and inlined into the notebook. Screenshot below. -
When closing the Python window, I get a beach ball spinning endlessly until I force close Python.app and from then on, my interactive window is broken. Running any cell (e.g.
print("hello")
) now throwsError: Session cannot generate requests at S.executeCodeCell (/Users/janosh/.vscode/extensions/ms-toolsai.jupyter-2021.10.1101450599/out/client/extension.js:66:301742) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:93:5) at S.execute (/Users/janosh/.vscode/extensions/ms-toolsai.jupyter-2021.10.1101450599/out/client/extension.js:66:300721)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
QVTKOpenGLWidget does not stop interaction in leaveEvent()
Tested with vtkInteractorStyleTrackballCamera. After QVTKOpenGLWidget is displayed: Push the left mouse button over renderer window.
Read more >Crash when starting vtkRenderer - Support - VTK Discourse
Hello, I am working on a program which computes a particular polynomial in the complex plane, then uses VTK to make a colorized...
Read more >Vtk charts break in QT, "no override found for ... - Stack Overflow
find_package(VTK COMPONENTS vtkChartsCore vtkCommonCore vtkCommonDataModel vtkInteractionStyle ... It seems I missed some libraries.
Read more >VTK: A Powerful Open Source Data Visualization Tool - Toptal
3D Data Visualization With Open Source Tools: A Tutorial Using VTK ... Render and show interactive window renWin->Render(); interact->Initialize(); ...
Read more >Introduction to Python and VTK - Centre for Image Analysis
and VTK. Scientific Visualization, HT 2014. Lecture 2. Johan Nysjö. Centre for Image analysis. Swedish University of Agricultural Sciences.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PLease could you provide the logs from the
Jupyter
output panel. Looks like the kernel is dying. Also can you try this in Jupyter Notebook (outside vscode) and confirm the kernel doesn’t die there either.Basically I don’t think this is a problem with VS Code, we don’t kill the kernel, here it looks like the kernel died for some external reason.
@DonJayamanne You’re right, same thing happening in Jupyter. Closing as unrelated to VS Code.