jupyter-cadquery
jupyter-cadquery copied to clipboard
Problems with "show" in VS Code / Jupyter-Notebook
show(obj)
works fine in VS Code with Jupyter-Notebook extension for a certain number of executions.
After a while, the show
command does not display any graphics anymore. I have tried changing the "presentation" options in VS Code, without success.
Do you know what the problem could be?
Restarting the Jupyter kernel does not help... I have to restart VS Code...
@christianhauschel I tried to reproduce with the latest VS Code flipping between two different models continuously. Sometimes the communication gets slow, but it worked all the time. Do you have a notebook where you can reproduce it?
Can confirm I am having the issue on the latest version of Visual Studio Code, Cadquery, jupyter-cadquery, and Python extension
Tried running in both ipynb and py formats. Also tried reinstalling ipykernel without any changes
Code
from jupyter_cadquery import set_defaults, open_viewer
set_defaults(theme="dark")
open_viewer("CadQuery")
Python 3.9.12
conda 4.13.0
jupyter-cadquery-3.0.0
Visual Studio Code Version: 1.68.1
Here is my vscode docker devcontainer if that helps with repro
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
# RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
RUN apt-get update -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN conda install -c conda-forge -c cadquery cadquery=master && \
conda clean -a -y
@christianhauschel @afshawnlotfi Now I better understand the issue. I wasn't aware of ˋipywidgetsˋ being supported by VS Code in the meantime. I can reproduce your error now, however, it seems to lie in the ˋipywidgetsˋ implementation of VS Code.
I have no idea how to track that down at the moment and unfortunately need to flag direct support via notebooks in VS Code as currently not supported. You might want to look at the viewer approach of Jupyter-CadQuery