Jupyter Notebooks in VSCode

Hi all,

We followed the instructions on this forum to add vscode to the jupyter launchers, and we are enjoying it!

As an added feature, we would like to run our python notebooks within VSCode. Is it possible and if yes, what would be the best option to achieve this?

Thanks a lot for your reply!

Best,
– Damien

1 Like

There is official documentation for that, as I use PyCharm I can’t give you any hints, but if PyCharm manages to run them I think VSCode does as well:

2 Likes

Hi @Damien, you need to install the python + jupyter extensions. However, this can be somewhat brittle as the VSCode clone that we use (code-server) can sometimes have some issues with extensions. The python extension should be installed if you use our script to install it in your image but it’s possible that the code-server version needs to be bumped. I haven’t had a chance to try, but will do so asap.

Irrespective of these issues, you can find the (quite extensive) docs for Python in VSCode here: Python in Visual Studio Code

2 Likes

Thanks for your replies.

@rrrrrok We have been using the script you linked to, so maybe there are some updates necessary. I will have a closer look at it.

@pascal.baumann Are you using PyCharm within Renku sessions? If so, I would love to have a look at some install scripts and the configuration you use to install it and run your notebooks in there.

@Damien I just tried with this in a Dockerfile:

ARG VSCODE_VERSION=4.7.0 
RUN curl -s https://raw.githubusercontent.com/SwissDataScienceCenter/renkulab-docker/master/scripts/install-vscode.sh | bash

and it worked mostly out of the box. It indicates that the python extension needs a reload, though it also seems to work already without doing that explicitly.

1 Like

Thanks for the help.

We were missing the VSCODE_VERSION arg in the Dockerfile so it used an older version. I tried with the newer version but now it seems I cannot even open jupyter notebooks anymore with vscode. We are using the renkulab-py:3.9-0.12.0 Docker image.

I will have to get a closer look at it to get more information. Unfortunately, I don’t have access to Docker on my enterprise laptop, so all I have to test things is Renku.

Hmm that doesn’t sound good. Is there a project you can share with me, or push a minimal version of the setup you are using to renkulab.io so I can try to debug it?