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

Document using Sage on Windows via Visual Studio Code with WSL remote #30484

Closed
mkoeppe opened this issue Sep 1, 2020 · 38 comments
Closed

Document using Sage on Windows via Visual Studio Code with WSL remote #30484

mkoeppe opened this issue Sep 1, 2020 · 38 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Sep 1, 2020

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

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

References:

Depends on #33131
Depends on #33103

CC: @tobiasdiez @EmmanuelCharpentier @sagetrac-tmonteil @kcrisman @louisng @kwankyu @tscrim @slel

Component: user interface

Author: Louis Ng, Matthias Koeppe

Branch/Commit: 79552c6

Reviewer: Tobias Diez, Kwankyu Lee

Issue created by migration from https://trac.sagemath.org/ticket/30484

@mkoeppe mkoeppe added this to the sage-9.2 milestone Sep 1, 2020
@tobiasdiez
Copy link
Contributor

comment:1

A basic how to setup VS code for sage (from #25206 comment:63):

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 8, 2020

comment:2

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

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@dimpase
Copy link
Member

dimpase commented Nov 7, 2020

comment:4

Replying to @tobiasdiez:

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

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

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 24, 2021

comment:5

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.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 9, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

Dependencies: #30677

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe changed the title Visual Studio (vscode) configuration Documentation/configuration for Visual Studio (vscode) with a WSL remote Jan 10, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 10, 2022

Changed dependencies from #30677 to #33131, #33103

@mkoeppe mkoeppe changed the title Documentation/configuration for Visual Studio (vscode) with a WSL remote Documentation/configuration for Sage on Windows using Visual Studio (vscode) with a WSL remote Jan 10, 2022
@dimpase
Copy link
Member

dimpase commented Apr 7, 2022

comment:11

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...

@tobiasdiez
Copy link
Contributor

comment:12

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.

@dimpase
Copy link
Member

dimpase commented Apr 7, 2022

comment:13

Replying to @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.

@tobiasdiez
Copy link
Contributor

comment:14

Attachment: Screenshot 2022-04-08 201448.png

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

@louisng114
Copy link
Mannequin

louisng114 mannequin commented Apr 9, 2022

comment:16

The link https://code.visualstudio.com/remote-tutorials/wsl/edit-and-debug does not seem to work.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 9, 2022

comment:17

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

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 9, 2022

comment:18

Or maybe this one: https://code.visualstudio.com/docs/remote/wsl-tutorial

@dimpase
Copy link
Member

dimpase commented Apr 9, 2022

comment:19

Replying to @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.

@mkoeppe

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 19, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

6881dd6Changed phrasing regarding the command palette

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 19, 2022

Changed commit from 8a4eb05 to 6881dd6

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 19, 2022

comment:26

On macOS, its Cmd + Shift + P. Perhaps also include the link to the VS Code documentation?

@tobiasdiez
Copy link
Contributor

comment:27

Replying to @sagetrac-git:

Branch pushed to git repo; I updated commit sha1. New commits:

6881dd6Changed phrasing regarding the command palette

Thanks!

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 3, 2022

Changed commit from 6881dd6 to b0c907e

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 3, 2022

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b29ccb9added VC Code WSL Jupyter section
8389ebcChanged phrasing regarding the command palette
b0c907esrc/doc/en/installation/launching.rst: Add markup for key chords

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 6, 2022

comment:34

I am new to the Visual Studio Code interface to the sagemath installed in WSL.

I followed the guide of the branch of this ticket. It mostly worked.

But in the first attempt, I could not select SageMath kernel in the jupyter notebook. It was simply missing.

I wandered around for some time, and then found Jupyter Extension in the Extensions panel. I installed it, and did the ":Create: New Jupyter Notebook" thing again. Then I could finally select SageMath kernel.

So it seems that there is a missing step in the guide: "Install Jupyter Extension"

Anyway, this VSCode interface to sage is very nice!

Still it was not straightforward for me to setup the working jupyter notebook with sagemath kernel starting from building sage from source in WSL.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 6, 2022

comment:35

Thanks for testing it! I'll add this step

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 6, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

79552c6src/doc/en/installation/launching.rst: Also mention Jupyter Extension

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 6, 2022

Changed commit from b0c907e to 79552c6

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 6, 2022

Changed author from Louis Ng to Louis Ng, Matthias Koeppe

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 6, 2022

Changed reviewer from Tobias Diez to Tobias Diez, Kwankyu Lee

@kwankyu
Copy link
Collaborator

kwankyu commented Aug 6, 2022

comment:38

Replying to @mkoeppe:

Thanks for testing it! I'll add this step

Thanks. It looks good to me.

@kwankyu kwankyu changed the title Documentation/configuration for Sage on Windows using Visual Studio (vscode) with a WSL remote Documentation for Sage on Windows using Visual Studio (vscode) with WSL remote Aug 6, 2022
@kwankyu kwankyu changed the title Documentation for Sage on Windows using Visual Studio (vscode) with WSL remote Document using Sage on Windows via Visual Studio Code with WSL remote Aug 6, 2022
@kwankyu

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 6, 2022

comment:42

Thanks!

@vbraun
Copy link
Member

vbraun commented Aug 7, 2022

Changed branch from public/30484 to 79552c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants