Pylance-release: How does pylance check for imports

Created on 2 Sep 2020  路  11Comments  路  Source: microsoft/pylance-release

I'm running remote development with singularity (the only option we have available).

While it works perfectly specifying the python interpreter, pointing to the interpreter running in the singularity image, when executing code. It seems that pylance is not picking up the installed dependencies from the specified python interpreter. (And I also don't understand which it actually uses to check the code, since I did not specify another one.)

So I end up with a lot of import errors and no autocompletion, e.g.
Import "numpy" could not be resolvedPylance (reportMissingImports),
while the script executes without any issue.

waiting for info

Most helpful comment

I have a similar issue to what has been reported so far. Although, I am simply importing a python file I created and not a module.
Screenshot 2020-10-10 at 19 50 12

As with other's experience, the script runs fine regardless.

All 11 comments

Can you provide trace logs so we can see what files are being accessed and their schemes? See: https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#filing-an-issue (also in the bug template)

I'm not sure how singularity works, but one of the problems with "remotes" in VS Code is that they don't actually run the language server on the remote host, instead creating fake filesystems that are only accessible in the editor. It could be similar here where Pylance is running on the host and can't access the actual environment.

Some more information:
Pylance Version: v2020.8.3

Some more specifics for the remote setup:
settings.json:
{ "terminal.integrated.shell.linux": "./get_worker.sh", "python.pythonPath": "./singularity_python.sh", "python.analysis.logLevel": "Trace", "python.linting.pycodestyleEnabled": true, "python.linting.enabled": true, } ,
where ./get_worker.sh requests a new shell on a compute node.
and ./singularity_python.sh, specifies the python interpreter from a singularity containter running in the compute node:
singularity exec --bind . --pwd $PWD docker://some-python-image python "$@"

Output tab from the "Python Language Server":
[Info - 8:55:42 AM] Pylance language server 2020.8.3 (pyright 8c5415fd) starting [Info - 8:55:42 AM] Server root directory: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server [Info - 8:55:42 AM] No configuration file found. [Info - 8:55:42 AM] Setting pythonPath for service "docker_remote": "*******/**********/singularity_python.sh" [Error - 8:55:43 AM] stubPath *******/**********/typings is not a valid directory. [Info - 8:55:43 AM] Assuming Python version 3.8 [Info - 8:55:43 AM] Assuming Python platform Linux [Info - 8:55:43 AM] Searching for source files [Info - 8:55:43 AM] Found 1 source file [Info - 8:55:43 AM] Background analysis root directory: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server [Info - 8:55:43 AM] Background analysis started [BG] analyzing: *******/**********/test.py ... [BG] parsing: *******/**********/test.py (36ms) [BG] parsing: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/2and3/builtins.pyi (206ms) [BG] binding: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/2and3/builtins.pyi (71ms) [BG] binding: *******/**********/test.py (2ms) [BG] checking: *******/**********/test.py ... [BG] parsing: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/3/sys.pyi (21ms) [BG] binding: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/3/sys.pyi (5ms) [BG] parsing: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/3/os/__init__.pyi (64ms) [BG] binding: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/3/os/__init__.pyi (25ms) [BG] parsing: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/3/typing.pyi (26ms) [BG] binding: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/3/typing.pyi (26ms) [BG] parsing: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (17ms) [BG] binding: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (6ms) [BG] checking: *******/**********/test.py (238ms) [BG] analyzing: *******/**********/test.py (555ms) [FG] parsing: *******/**********/test.py (22ms) [FG] parsing: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/2and3/builtins.pyi (201ms) [FG] binding: *******/.vscode-server/extensions/ms-python.vscode-pylance-2020.8.3/server/typeshed-fallback/stdlib/2and3/builtins.pyi (67ms) [FG] binding: *******/**********/test.py (1ms)

I'm aware that this is a rather complicated setup (SSH Remote to cluster login node -> Redirected to a compute node -> Python interpreter running in a container on that compute node), however, the script execution works like a charm, it is really the code analysis that is having trouble.

How can I see from the looks which python path/interpreter is actually checked @jakebailey

You sorta cut out the most important part of the paths; the prefix. Do they start with sshfs:// or similar? That's what I'm looking for. I'm not sure that this is SSHFS, though, given it's using .vscode-server (which is a good sign that we should be working).

We pull that pythonPath config in order to run python, so that path needs to exist where the VS Code server is running, otherwise we may not end up working. I would expect other Python extension features to dependent on that; so there might be more insight in the Python output window.

I have the same problem and filed a question on stackoverflow. I initially had absolutely no code completion / docs popup working and after switching to Pylance (previously it was Microsoft), I had them working. But as mentioned in this issue, it couldn't recognize the pip modules inside the container.

image

Mine's a very similar setup too and I've put the logs down below, I replaced the original dirs with homepath and projpath and left the rest just as it is:


Language Server Log

[Info  - 6:11:32 PM] Pylance language server 2020.9.8 (pyright a0620921) starting
[Info  - 6:11:32 PM] Server root directory: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist
[Info  - 6:11:32 PM] No configuration file found.
[Info  - 6:11:32 PM] Setting pythonPath for service "test_pyproj": "/projpath/test_pyproj/python"
No search paths found for configured python interpreter.
[Error - 6:11:32 PM] stubPath /projpath/test_pyproj/typings is not a valid directory.
[Info  - 6:11:32 PM] Assuming Python version 3.7
[Info  - 6:11:32 PM] Assuming Python platform Linux
[Info  - 6:11:32 PM] Searching for source files
[Info  - 6:11:32 PM] Found 1 source file
[Info  - 6:11:32 PM] Background analysis(1) root directory: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist
[Info  - 6:11:32 PM] Background analysis(1) started
Background analysis message: setConfigOptions
Background analysis message: setTrackedFiles
[FG] parsing: /projpath/test_pyproj/test.py (12ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (210ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (67ms)
[FG] binding: /projpath/test_pyproj/test.py (1ms)
Background analysis message: markAllFilesDirty
Background analysis message: setFileOpened
Background analysis message: analyze
[BG(1)] analyzing: /projpath/test_pyproj/test.py ...
[BG(1)]   parsing: /projpath/test_pyproj/test.py (22ms)
[BG(1)]   parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (215ms)
[BG(1)]   binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/builtins.pyi (67ms)
[BG(1)]   binding: /projpath/test_pyproj/test.py (1ms)
[BG(1)]   checking: /projpath/test_pyproj/test.py ...
[BG(1)]     parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (12ms)
[BG(1)]     binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (3ms)
[BG(1)]     parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/third_party/2and3/typing_extensions.pyi (7ms)
[BG(1)]     binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/third_party/2and3/typing_extensions.pyi (2ms)
[BG(1)]     parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/typing.pyi (54ms)
[BG(1)]     binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/typing.pyi (17ms)
[BG(1)]   checking: /projpath/test_pyproj/test.py (120ms)
[BG(1)] analyzing: /projpath/test_pyproj/test.py (427ms)
Background analysis message: getSemanticTokens
Background analysis message: getSemanticTokens
Background analysis message: resumeAnalysis
IntelliCode model /homepath/.vscode-server/extensions/visualstudioexptteam.vscodeintellicode-1.2.10/cache/E61945A9A512ED5E1A3EE3F1A2365B88F8FE_E4E9EADA96734F01970E616FAB2FAC19
Loading ONNX runtime...
Loaded ONNX runtime. Creating IntelliCode session...
2020-10-07 18:11:34.354809256 [I:onnxruntime:, inference_session.cc:174 ConstructorCommon] Creating and using per session threadpools since use_per_session_threads_ is true
2020-10-07 18:11:34.357154873 [I:onnxruntime:, inference_session.cc:840 Initialize] Initializing session.
2020-10-07 18:11:34.357366831 [I:onnxruntime:, inference_session.cc:865 Initialize] Adding default CPU execution provider.
2020-10-07 18:11:34.359518865 [I:onnxruntime:, reshape_fusion.cc:37 ApplyImpl] Total fused reshape node count: 0
2020-10-07 18:11:34.360469490 [I:onnxruntime:, reshape_fusion.cc:37 ApplyImpl] Total fused reshape node count: 0
2020-10-07 18:11:34.366590864 [V:onnxruntime:, inference_session.cc:679 TransformGraph] Node placements
2020-10-07 18:11:34.366716825 [V:onnxruntime:, inference_session.cc:681 TransformGraph] All nodes have been placed on [CPUExecutionProvider].
2020-10-07 18:11:34.366858635 [V:onnxruntime:, session_state.cc:71 CreateGraphInfo] SaveMLValueNameIndexMapping
2020-10-07 18:11:34.367015788 [V:onnxruntime:, session_state.cc:116 CreateGraphInfo] Done saving OrtValue mappings.
2020-10-07 18:11:34.368384271 [I:onnxruntime:, finalize_session_state.cc:173 SaveInitializedTensors] Saving initialized tensors.
2020-10-07 18:11:34.442090834 [I:onnxruntime:, finalize_session_state.cc:225 SaveInitializedTensors] Done saving initialized tensors
2020-10-07 18:11:34.446610849 [I:onnxruntime:, inference_session.cc:954 Initialize] Session successfully initialized.
Created IntelliCode session.
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: getSemanticTokens
[BG(1)] parsing: /projpath/test_pyproj/test.py (8ms)
[BG(1)] binding: /projpath/test_pyproj/test.py (1ms)
Background analysis message: analyze
[BG(1)] analyzing: /projpath/test_pyproj/test.py ...
[BG(1)]   checking: /projpath/test_pyproj/test.py (2ms)
[BG(1)] analyzing: /projpath/test_pyproj/test.py (2ms)
Background analysis message: resumeAnalysis
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] parsing: /projpath/test_pyproj/test.py (3ms)
[FG] binding: /projpath/test_pyproj/test.py (0ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (16ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/2and3/_typeshed/__init__.pyi (3ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/third_party/2and3/typing_extensions.pyi (5ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/third_party/2and3/typing_extensions.pyi (2ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/typing.pyi (61ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/typing.pyi (23ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/abc.pyi (6ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/abc.pyi (1ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/ast.pyi (19ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/ast.pyi ...
[FG]   parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/_ast.pyi (10ms)
[FG]   binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/_ast.pyi (7ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/ast.pyi (24ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/types.pyi (11ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/types.pyi (7ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/os/__init__.pyi (36ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/os/__init__.pyi (24ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/io.pyi (10ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/io.pyi (3ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/_importlib_modulespec.pyi (2ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/_importlib_modulespec.pyi (0ms)
[FG] parsing: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/posix.pyi (3ms)
[FG] binding: /homepath/.vscode-server/extensions/ms-python.vscode-pylance-2020.9.8/dist/typeshed-fallback/stdlib/3/posix.pyi (1ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 3 ms, Memory increase: 108 KB.
Background analysis message: analyze
[BG(1)] analyzing: /projpath/test_pyproj/test.py ...
[BG(1)]   parsing: /projpath/test_pyproj/test.py (1ms)
[BG(1)]   binding: /projpath/test_pyproj/test.py (0ms)
[BG(1)]   checking: /projpath/test_pyproj/test.py (4ms)
[BG(1)] analyzing: /projpath/test_pyproj/test.py (5ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
Background analysis message: getSemanticTokens
[BG(1)] parsing: /projpath/test_pyproj/test.py (1ms)
[BG(1)] binding: /projpath/test_pyproj/test.py (0ms)
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] parsing: /projpath/test_pyproj/test.py (0ms)
[FG] binding: /projpath/test_pyproj/test.py (0ms)
IntelliCode: current invocation did not produce any meaningful tokens.
Time taken to get recommendations: 1 ms, Memory increase: 15 KB.
Background analysis message: getSemanticTokens
[BG(1)] parsing: /projpath/test_pyproj/test.py (1ms)
[BG(1)] binding: /projpath/test_pyproj/test.py (0ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: analyze
[BG(1)] analyzing: /projpath/test_pyproj/test.py ...
[BG(1)]   checking: /projpath/test_pyproj/test.py (3ms)
[BG(1)] analyzing: /projpath/test_pyproj/test.py (3ms)
Background analysis message: resumeAnalysis
Background analysis message: setFileOpened
Background analysis message: markFilesDirty
[FG] parsing: /projpath/test_pyproj/test.py (0ms)
[FG] binding: /projpath/test_pyproj/test.py (0ms)
Background analysis message: analyze
[BG(1)] analyzing: /projpath/test_pyproj/test.py ...
[BG(1)]   parsing: /projpath/test_pyproj/test.py (1ms)
[BG(1)]   binding: /projpath/test_pyproj/test.py (0ms)
[BG(1)]   checking: /projpath/test_pyproj/test.py (2ms)
[BG(1)] analyzing: /projpath/test_pyproj/test.py (3ms)
Background analysis message: resumeAnalysis
Background analysis message: getSemanticTokens
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange

I have a similar issue to what has been reported so far. Although, I am simply importing a python file I created and not a module.
Screenshot 2020-10-10 at 19 50 12

As with other's experience, the script runs fine regardless.

@mikeysan what comes to mind is a wrong import. the directory phoducation-bot is your root module, hence the config import should be phoducation-bot.config. it will still work at runtime, because python will discover something called config in your project root directory, but pylance expects things a bit differently, i.e. import config will look at a config package (folder or single file) in your virtualenv (should you use one), i.e. .venv/lib/python3.8/site-packages/config. Python module structure.

|
+---phoducation-bot
|   |
|   +---module
|   |   |
|   |   +---__init_.py
|   |   +---foo.py
|   |
|   +---config.py
|
...

To import phoducation-bot/config.py in phoducation-bot/module/foo.py you must use from phoducation-bot.config import .... In your case, it's looking for config in the native or installed packages, of which there are none.

You can also interpret it that way: From pylance's perspective, the runtime root is the repository root (which is the folder retweet-anything you've opened in VSCode), but for python, the runtime root is (probably, don't know your exec command) phoducation-bot. That's a significant difference :)

Thanks for the explanation @felixhammerl. I will give your suggestion a try as soon as possible.

UPDATE:
I tried following your suggestion, but it didn't work. Below is an exact replication of my path.

|
+---phoducation-bot
|    |
|.   |
|    +--.env
|    +---config.py
|    +---bot.py
|
...

I have decided to use the advice given in https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md for the time being. Plus, I now have a better understanding of why it wasn't working, so again, thank you.

I think I was able to track down what went wrong.
Seems like pylance gets the interpreter path out of the singularity container and then tries to uses this path locally, see the bold log below.

However, I don't know how this could be fixed @jakebailey

`
User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
User belongs to experiment group 'pythonaa'

conda --version
pyenv root
python3.7 ~/.vscode-server/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
python3.6 ~/.vscode-server/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
python3 ~/.vscode-server/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
python2 ~/.vscode-server/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Error 2020-11-25 11:15:12: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://ssh-remote+inhsshnode01/home/xxxxxx/.config/Code/User/settings.json' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '/home/xxxxxx/.config/Code/User/settings.json')
at _handleError (/home/xxxxxx/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe8f/out/vs/server/remoteExtensionHostProcess.js:754:838)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async y.readText (/home/xxxxxx/.vscode-server/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:9:152841)
at async p.doesFileNeedToBeFixed (/home/xxxxxx/.vscode-server/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:469606)
at async /home/xxxxxx/.vscode-server/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:468733
at async Promise.all (index 0)
at async p.getFilesToBeFixed (/home/xxxxxx/.vscode-server/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:468679)
at async p.updateTestSettings (/home/xxxxxx/.vscode-server/extensions/ms-python.python-2020.11.371526539/out/client/extension.js:39:468306)] {
code: 'FileNotFound',
name: 'EntryNotFound (FileSystemError)'
}
python ~/.vscode-server/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
~/code/yyyyyyy/.vscode/singularity_python.sh ~/.vscode-server/extensions/ms-python.python-2020.11.371526539/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
conda info --json
Error 2020-11-25 11:15:13: Detection of Python Interpreter for Command /home/xxxxxx/code/yyyyyyy/.vscode/singularity_python.sh and args failed as file /usr/local/bin/python does not exist
conda env list
pyenv root
pyenv root
pyenv root
pyenv root
conda env list
pyenv root
pyenv root
pyenv root
Starting Pylance language server.
Python interpreter path: ./.vscode/singularity_python.sh
pyenv root
pyenv root
pyenv root
`

For Pylance to work, Pylance needs to be running where the code lives; this is how VSC's typical remote systems work (SSH, WSL) by running VS Code in server mode on the other system. Since we'd run there, the paths are valid. I don't know how Singularity works under the hood, but it'd need to do that as well as there's no abstraction for the file system that works with language servers (and it's expected that LSs read straight from disk). VS Code itself has fancy APIs to do that, but the LSP does not.

Closing issue. Please reopen if necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

albireox picture albireox  路  5Comments

PedroMDuarte picture PedroMDuarte  路  5Comments

BrunoBlanes picture BrunoBlanes  路  4Comments

andyljones picture andyljones  路  5Comments

notatallshaw picture notatallshaw  路  4Comments