Opened 2 years ago

Last modified 4 months ago

#30484 closed enhancement

Documentation/configuration for Sage on Windows using Visual Studio (vscode) with a WSL remote — at Version 20

Reported by: Matthias Köppe Owned by:
Priority: critical Milestone: sage-9.7
Component: user interface Keywords:
Cc: Tobias Diez, Emmanuel Charpentier, Thierry Monteil, Karl-Dieter Crisman, gh-louisng, Kwankyu Lee, Travis Scrimshaw, Samuel Lelièvre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #33131, #33103 Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

We already have a basic VS Code configuration; #33103 makes some minor updates.

In this ticket, we add documentation for installing VS Code on Windows and setting up the WSL remote, as the primary way how to use Sage on Windows. This goes to

We also cross reference it from the developer's guide and add information there on how to develop Sage on Windows.

References:

Change History (21)

comment:1 Changed 2 years ago by Tobias Diez

A basic how to setup VS code for sage (from https://trac.sagemath.org/ticket/25206#comment:63):

comment:2 Changed 2 years ago by Matthias Köppe

Should also add instructions for cygwin shell under VS code; random link - https://superuser.com/questions/1511487/cygwin-shell-in-vs-code-tries-to-activate-conda-how-to-prevent-this

comment:3 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.2sage-9.3

comment:4 in reply to:  1 Changed 2 years ago by Dima Pasechnik

Replying to gh-tobiasdiez:

  • Use ./sage -br to trigger a rebuild of sage.

I'd suggest make build && ./sage instead.

comment:5 Changed 21 months ago by Matthias Köppe

Milestone: sage-9.3sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

comment:6 Changed 16 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:7 Changed 14 months ago by Matthias Köppe

Dependencies: #30677

comment:8 Changed 12 months ago by Matthias Köppe

Milestone: sage-9.5sage-9.6

comment:9 Changed 11 months ago by Matthias Köppe

Summary: Visual Studio (vscode) configurationDocumentation/configuration for Visual Studio (vscode) with a WSL remote

comment:10 Changed 11 months ago by Matthias Köppe

Cc: Emmanuel Charpentier Thierry Monteil Karl-Dieter Crisman added
Dependencies: #30677#33131, #33103
Description: modified (diff)
Summary: Documentation/configuration for Visual Studio (vscode) with a WSL remoteDocumentation/configuration for Sage on Windows using Visual Studio (vscode) with a WSL remote

comment:11 Changed 8 months ago by Dima Pasechnik

Hmm, I can't figure out how to use vscode with a Sage notebook. The problem is to get vscode to find the correct kernel...

comment:12 Changed 8 months ago by Tobias Diez

At least for a "normal" jupyter notebook, selecting the venv created by sage worked for me.

There is also the possibility to connect to a "remote" jupyter instance. https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_connect-to-a-remote-jupyter-server So if you start sage's jupyter server, you should be able to connect to it in this way.

comment:13 in reply to:  12 Changed 8 months ago by Dima Pasechnik

Replying to gh-tobiasdiez:

At least for a "normal" jupyter notebook, selecting the venv created by sage worked for me.

The question is, how does vscode's jupyter discover kernels? Where? What should be set?

There is also the possibility to connect to a "remote" jupyter instance. https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_connect-to-a-remote-jupyter-server So if you start sage's jupyter server, you should be able to connect to it in this way.

Changed 8 months ago by Tobias Diez

comment:14 Changed 8 months ago by Tobias Diez

In the upper right corner you can select the kernel/python version, see attached screenshot.

comment:15 Changed 8 months ago by Matthias Köppe

Cc: gh-louisng added

comment:16 Changed 8 months ago by gh-louisng114

comment:17 Changed 8 months ago by Matthias Köppe

Not sure if it has just moved or this is a different document: https://code.visualstudio.com/docs/remote/wsl

comment:19 in reply to:  14 Changed 8 months ago by Dima Pasechnik

Replying to gh-tobiasdiez:

In the upper right corner you can select the kernel/python version, see attached screenshot.

it's rather unpredictable whether Sage jupyter kernel will be available. Often it's just not there. Perhaps it needs to installed to a specific location.

Last edited 8 months ago by Dima Pasechnik (previous) (diff)

comment:20 Changed 8 months ago by Matthias Köppe

Description: modified (diff)
Note: See TracTickets for help on using tickets.