vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

Suggested extensions aren't installed when connecting over SSH

Open kryptan opened this issue 1 year ago • 1 comments

Applies To

  • [ ] Notebooks (.ipynb files)
  • [ ] Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

  1. Connect to the remote machine using the Remote - SSH extension.
  2. Open any Python notebook (*.ipynb) on the remote machine.
  3. Press Select Kernel button.
  4. Press Install/Enable suggested extensions in the popup: image
  5. VSCode is "installing" the extensions. image
  6. Nothing actually gets installed, the same popup from step 4 appears again.
  7. In the Extension tab we can see that nothing got installed on the remote machine. Installing suggested extensions manually does work though.

VS Code Version

Version: 1.81.1 (user setup) Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:22:42.175Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

Jupyter Extension Version

v2023.7.1002162226

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

N/A or Not sure

kryptan avatar Sep 02 '23 09:09 kryptan

If anyone is interested, a work-around is to configure VSCode to automatically install the required packages for all remote SSH connections. This can be done by editing the settings.json file as explained here.

Each extension has a unique identifier listed under "More Info". For example, for the Python extension, the unique identifier is "ms-python.python".

Modifying settings.json is explained here, or in short follow the instructions below for Windows:

  1. F1 to open the command pallet, type "open settings", select "Open User Settings (JSON)". This will open settings.json
  2. Add the following key:value pair to the dict:
"remote.SSH.defaultExtensions": [
        "ms-toolsai.jupyter",
        "ms-python.python"
    ]
  1. Save and close VSCode. Re-launch VSCode and the extensions should be installed.
  2. Click on "Select Kernel", choose the kernel from the existing venv directory.
  3. Click OK when prompted to install ipython extension. "Select Kernel" on the top bar should be replaced with the selected kernel (e.g. "venv (Python 3.8.10)").

ctorti avatar May 02 '24 11:05 ctorti