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

Problems with "show" in VS Code / Jupyter-Notebook #80

Open
christianhauschel opened this issue May 11, 2022 · 5 comments
Open

Problems with "show" in VS Code / Jupyter-Notebook #80

christianhauschel opened this issue May 11, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@christianhauschel
Copy link

christianhauschel commented May 11, 2022

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?

@christianhauschel
Copy link
Author

image

@christianhauschel
Copy link
Author

Restarting the Jupyter kernel does not help... I have to restart VS Code...

@bernhard-42
Copy link
Owner

@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?

@afshawnlotfi
Copy link

afshawnlotfi commented Jun 17, 2022

Can confirm I am having the issue on the latest version of Visual Studio Code, Cadquery, jupyter-cadquery, and Python extension
image

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

@bernhard-42
Copy link
Owner

@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

@bernhard-42 bernhard-42 added enhancement New feature or request help wanted Extra attention is needed labels Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants