On a remote server, kernel picker doesn't show virtual environments
See original GitHub issueIssue Type: Bug
I use the Remote - SSH and Python extensions to run Python code on a remote server. I created a virtual environment test_venvon the remote server I connect to, which contains pandas and jupyter. I’m able to select this environment in VS Code:

I can run a simple Python script from VS Code using this interpreter:
import pandas as pd
filename = 'test.csv'
df = pd.read_csv(filename)
print(df)
This runs fine. However, if I try to run a Jupyter notebook which does the same things:
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": 3
},
"orig_nbformat": 2
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"import pandas as pd"
],
"cell_type": "code",
"metadata": {},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"filename = 'test.csv'\n",
"df = pd.read_csv(filename)\n",
"print(df)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}
VS Code complains that ipykernel is not installed, and it doesn’t run the notebook:

This means that VS Code uses the selected environment when running a Python script, but not when running a notebook, as also confirmed by the fact that it’s trying to use Python 2.7 (the virtual environment has Python 3.8) . This is a major bug: basically you cannot run Jupyter notebooks with VS Code on remote servers.
Extension version: 2021.5.842923320 VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:44:30.902Z) OS version: Darwin x64 19.6.0 Remote OS version: Linux x64 5.4.0-52-generic
System Info
| Item | Value |
|---|---|
| CPUs | Intel® Core™ i7-7820HQ CPU @ 2.90GHz (8 x 2900) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled |
| Load (avg) | 2, 2, 2 |
| Memory (System) | 16.00GB (0.87GB free) |
| Process Argv | –crash-reporter-id df4f7917-f728-4290-9500-a3632318c3e7 |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | SSH: xxxx |
| OS | Linux x64 5.4.0-52-generic |
| CPUs | Intel® Xeon® CPU E5-2698 v4 @ 2.20GHz (80 x 2696) |
| Memory (System) | 503.78GB (343.49GB free) |
| VM | 0% |
Issue Analytics
- State:
- Created 2 years ago
- Comments:7

Top Related StackOverflow Question
I have another couple of questions/suggestions @AndreaPi.
Installing the new Jupyter release (which just recently came out) solved everything! Thank you @DavidKutu . Closing the issue now