Skip to content

intellisense doesn't work in jupyter notebooks on a remote server when an anaconda env is chosen for running the kernel #4226

Closed

Description

Type: Bug

  1. I connect to Ubuntu Server and open jupyter notebook.
  2. From the drop down for selecing the kernel if I select 'Python 3.10.6 /bin/python3' intellisense works (even the advanced functionality, like column names for pandas).
  3. If I select an anaconda env '<env_name> (Python 3.8.15) ~/miniconda3/envs/<env_name>/bin/python' intellisense doesn't work.

This is a huge issue for people working in data science/ml since anaconda (or its flavors) is what most of us use.

Here is a screenshot of selecting the kernel:
image

Nothing triggers completions, even ctrl+space
image

VS Code version: Code 1.77.0 (7f329fe6c66b0f86ae1574c2911b681ad5a45d63, 2023-03-29T10:02:16.981Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.0-69-generic

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2304)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.73GB (10.33GB free)
Process Argv --crash-reporter-id 343d629c-3582-46e1-84af-07d42196c000
Screen Reader no
VM 0%
Item Value
Remote SSH: 192.168.20.14
OS Linux x64 5.15.0-69-generic
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 2200)
Memory (System) 62.69GB (60.12GB free)
VM 0%
Extensions (15)
Extension Author (truncated) Version
remotehub Git 0.54.0
jupyter-keymap ms- 1.1.0
remote-ssh ms- 0.98.0
remote-ssh-edit ms- 0.84.0
azure-repos ms- 0.30.0
remote-explorer ms- 0.2.0
remote-repositories ms- 0.32.0
copilot Git 1.79.10634
python ms- 2023.6.0
vscode-pylance ms- 2023.3.40
jupyter ms- 2023.3.1000892223
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
nodejswelcome1cf:30587006
282f8724:30602487
pyind779:30671433
f6dab269:30613381
vscrp:30673768
pythonsymbol12:30671437
vsccsb:30677849
azdwalk:30687957
pythonms35:30701012

Activity

  1. Auxority commented on Apr 4, 2023

    @Auxority

    I have the same issue

  2. DonJayamanne commented on Apr 4, 2023

    @DonJayamanne
    Collaborator

    Thanks for filing this issue and sorry you are running into this issue.
    Please could you enable logging as follows:

    • Open settings & go into Jupyter->Logging
    • Change the value to verbose
    • Reload VS Code,
    • Attempt to repro the issue & then copy the output from the Jupyter output panel.
  3. radekosmulski commented on Apr 5, 2023

    @radekosmulski
    Author

    This is quite interesting, because turns out it sometimes works with Anaconda envs!

    This is for system python where intelisense has always worked for me so far:

    [Info  - 12:54:46 PM] (3767) Pylance language server 2023.3.40 (pyright 04471971) starting
    [Info  - 12:54:46 PM] (3767) Server root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist
    [Info  - 12:54:46 PM] (3767) Starting service instance "ai_experiments"
    [Info  - 12:54:46 PM] (3767) Auto-indent enabled
    [Info  - 12:54:46 PM] (3767) No configuration file found.
    [Info  - 12:54:46 PM] (3767) No pyproject.toml file found.
    [Info  - 12:54:46 PM] (3767) Setting pythonPath for service "ai_experiments": "/bin/python3"
    [Warn  - 12:54:46 PM] (3767) stubPath /home/radek/workspace/ai_experiments/typings is not a valid directory.
    [Info  - 12:54:46 PM] (3767) Assuming Python version 3.10
    [Info  - 12:54:46 PM] (3767) Assuming Python platform Linux
    [Info  - 12:54:46 PM] (3767) Searching for source files
    [Info  - 12:54:46 PM] (3767) No source files found.
    [Info  - 12:54:46 PM] (3767) Background analysis(1) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist
    [Info  - 12:54:46 PM] (3767) Background analysis(1) started
    [Info  - 12:54:47 PM] (3767) Indexer background runner(2) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist (index)
    [Info  - 12:54:47 PM] (3767) Indexing(2) started
    [Info  - 12:54:47 PM] (3767) scanned(2) 151 files over 1 exec env
    [Info  - 12:54:48 PM] (3767) indexed(2) 88 files over 1 exec env
    [Info  - 12:54:48 PM] (3767) Indexing finished(2).
    

    I then switched to using an Anaconda env and... to my surprise it worked! (I reloaded the window though using command palette, not sure if that played a role).

    But to reproduce the error I created a new file and picked the kernel only when I wanted to run the code. Then the issue came up again. There is an issue that comes up in the logs:

    [Info  - 12:56:32 PM] (4105) Pylance language server 2023.3.40 (pyright 04471971) starting
    [Info  - 12:56:32 PM] (4105) Server root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist
    [Info  - 12:56:32 PM] (4105) Starting service instance "ai_experiments"
    [Info  - 12:56:32 PM] (4105) Auto-indent enabled
    [Info  - 12:56:32 PM] (4105) No configuration file found.
    [Info  - 12:56:32 PM] (4105) No pyproject.toml file found.
    [Info  - 12:56:32 PM] (4105) Setting pythonPath for service "ai_experiments": "/bin/python3"
    [Warn  - 12:56:32 PM] (4105) stubPath /home/radek/workspace/ai_experiments/typings is not a valid directory.
    [Info  - 12:56:32 PM] (4105) Assuming Python version 3.10
    [Info  - 12:56:32 PM] (4105) Assuming Python platform Linux
    [Info  - 12:56:32 PM] (4105) Searching for source files
    [Info  - 12:56:32 PM] (4105) No source files found.
    [Info  - 12:56:32 PM] (4105) Starting service instance "ai_experiments"
    [Info  - 12:56:32 PM] (4105) No configuration file found.
    [Info  - 12:56:32 PM] (4105) No pyproject.toml file found.
    [Info  - 12:56:32 PM] (4105) Setting pythonPath for service "ai_experiments": "/home/radek/miniconda3/envs/rapids-22.10/bin/python"
    [Warn  - 12:56:32 PM] (4105) stubPath /home/radek/workspace/ai_experiments/typings is not a valid directory.
    [Info  - 12:56:32 PM] (4105) Assuming Python version 3.8
    [Info  - 12:56:32 PM] (4105) Assuming Python platform Linux
    [Info  - 12:56:32 PM] (4105) Searching for source files
    [Info  - 12:56:32 PM] (4105) No source files found.
    [Info  - 12:56:32 PM] (4105) Background analysis(1) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist
    [Info  - 12:56:32 PM] (4105) Background analysis(1) started
    [Info  - 12:56:33 PM] (4105) Background analysis(2) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist
    [Info  - 12:56:33 PM] (4105) Background analysis(2) started
    [Info  - 12:56:33 PM] (4105) Indexer background runner(3) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist (index)
    [Info  - 12:56:33 PM] (4105) Indexing(3) started
    [Info  - 12:56:33 PM] (4105) scanned(3) 469 files over 1 exec env
    [Info  - 12:56:37 PM] (4105) [IDX(3)] Long operation: index execution environment /home/radek/workspace/ai_experiments (3440ms)
    [Info  - 12:56:37 PM] (4105) [IDX(3)] Long operation: index packages /home/radek/workspace/ai_experiments (3447ms)
    [Info  - 12:56:37 PM] (4105) indexed(3) 304 files over 1 exec env
    [Info  - 12:56:37 PM] (4105) Indexing finished(3).
    [Info  - 12:59:14 PM] (4105) Indexer background runner(4) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist (index)
    [Info  - 12:59:14 PM] (4105) Indexing(4) started
    [Info  - 12:59:15 PM] (4105) scanned(4) 151 files over 1 exec env
    [Info  - 12:59:16 PM] (4105) indexed(4) 88 files over 1 exec env
    [Info  - 12:59:16 PM] (4105) Indexing finished(4).
    [Info  - 12:59:29 PM] (4105) Starting service instance "ai_experiments"
    [Info  - 12:59:29 PM] (4105) No configuration file found.
    [Info  - 12:59:29 PM] (4105) No pyproject.toml file found.
    [Info  - 12:59:29 PM] (4105) Setting pythonPath for service "ai_experiments": "/home/radek/miniconda3/envs/rapids-22.10/bin/python"
    [Warn  - 12:59:29 PM] (4105) stubPath /home/radek/workspace/ai_experiments/typings is not a valid directory.
    [Info  - 12:59:29 PM] (4105) Assuming Python version 3.8
    [Info  - 12:59:29 PM] (4105) Assuming Python platform Linux
    [Info  - 12:59:29 PM] (4105) Searching for source files
    [Info  - 12:59:29 PM] (4105) No source files found.
    [Info  - 12:59:29 PM] (4105) Background analysis(5) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist
    [Info  - 12:59:29 PM] (4105) Background analysis(5) started
    [Info  - 12:59:29 PM] (4105) Indexer background runner(6) root directory: /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist (index)
    [Info  - 12:59:29 PM] (4105) Indexing(6) started
    [Info  - 12:59:29 PM] (4105) scanned(6) 469 files over 1 exec env
    Error: Debug Failure. False expression: Chained file path doesn't match prefixCellFilePath
        at _0x20038d (/home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:474758)
        at /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:478944
        at _0x18414c (/home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:478976)
        at _0x2998c7._onDidChangeNotebookDocumentAsync (/home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:444100)
    [Info  - 12:59:33 PM] (4105) [IDX(6)] Long operation: index execution environment /home/radek/workspace/ai_experiments (3515ms)
    [Info  - 12:59:33 PM] (4105) [IDX(6)] Long operation: index packages /home/radek/workspace/ai_experiments (3526ms)
    [Info  - 12:59:33 PM] (4105) indexed(6) 304 files over 1 exec env
    [Info  - 12:59:33 PM] (4105) Indexing finished(6).
    

    And interestingly, if I reload the window (Developer: Reload window) the issue goes away!

  4. debonte commented on Apr 11, 2023

    @debonte
    Contributor

    Error: Debug Failure. False expression: Chained file path doesn't match prefixCellFilePath
    at _0x20038d (/home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:474758)
    at /home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:478944
    at _0x18414c (/home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:478976)
    at _0x2998c7._onDidChangeNotebookDocumentAsync (/home/radek/.vscode-server/extensions/ms-python.vscode-pylance-2023.3.40/dist/server.bundle.js:1:444100)

    Rich Chiodo (@rchiodo)

  5. rchiodo commented on Apr 11, 2023

    @rchiodo
    Contributor

    Can you try this with the latest version? 2023.4.11 had some fixes in it. This might have been this bug here:
    #4166

    2023.4.11 should be the latest 'prerelease' version of Pylance.

  6. Auxority commented on Apr 15, 2023

    @Auxority

    works for me 👍

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions