pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

DOUBLE language server started in vscode with conda

Open Fadelis98 opened this issue 2 years ago • 5 comments

Environment data

  • Language Server version: 2022.7.30
  • OS and version: linux x64
  • Python version :3.7 in anaconda env named 'scf'
  • python.analysis.indexing: null
  • python.analysis.typeCheckingMode: basic

Reproduce: just open any python file, then 2 different language servers started

image

the hint is doubled as well

image

Fadelis98 avatar Jul 14 '22 09:07 Fadelis98

I find it is the same as #3027

Fadelis98 avatar Jul 14 '22 11:07 Fadelis98

same issue here.

maxwellzh avatar Jul 19 '22 05:07 maxwellzh

Also having this issue

dtczest avatar Aug 01 '22 20:08 dtczest

More information: This bug happens after both .py file and .ipynb notebook are opened. It seems that the pylance server starts for each type of file once, but each server finally acts on both types of files.


edit: It's not the reason. This bug still exists with only .py file. It's just because one server started slower than another, I misdirected by it when I opened the notebook after I opened the .py file.

Fadelis98 avatar Aug 10 '22 09:08 Fadelis98

same issue on windows 11

SimonL888 avatar Aug 18 '22 07:08 SimonL888

Had the same issue. The suggestion from https://github.com/microsoft/pylance-release/issues/3027 -> python.pylanceLspNotebooksEnabled: true seems to have solved it for me.

cyclux avatar Nov 05 '22 01:11 cyclux

Had the same issue. The suggestion from https://github.com/microsoft/pylance-release/issues/3027 -> python.pylanceLspNotebooksEnabled: true seems to have solved it for me.

@Fadelis98, do you have python.pylanceLspNotebooksEnabled set to false?

debonte avatar Nov 05 '22 01:11 debonte

Had the same issue. The suggestion from #3027 -> python.pylanceLspNotebooksEnabled: true seems to have solved it for me.

@Fadelis98, do you have python.pylanceLspNotebooksEnabled set to false?

No, I set it to true . In another post you said the default is true now. Wondering why including pylanceLspNotebooksEnabled changed anything then, because I did not see this option anywhere before, so it should have been set to true anyway. You also said the default is depending on the implementation, maybe that's why. However, my setup should be up to date, including extensions. (btw: I'm using conda and Jupyter as well)

cyclux avatar Nov 05 '22 17:11 cyclux

I have the same issue but I don't find python.pylanceLspNotebooksEnabled in my settings.
I added this in a workspace settings.json but that doesnt change anything:

{
    "python.pylanceLspNotebooksEnabled": true
}

Additionally, how can I stop a language server?

ghost avatar Nov 07 '22 10:11 ghost

I have the same issue but I don't find python.pylanceLspNotebooksEnabled in my settings. I added this in a workspace settings.json but that doesnt change anything:

{
    "python.pylanceLspNotebooksEnabled": true
}

Additionally, how can I stop a language server?

That's exactly what I did. Did not try to stop a running one. But you can try "python.languageServer": "None" as a "hotfix" until a decent solution works for you.

cyclux avatar Nov 07 '22 13:11 cyclux

May be related to / dupe of https://github.com/microsoft/vscode-jupyter/issues/11938

debonte avatar Nov 07 '22 20:11 debonte

An indicator that this problem is caused by the jupyter issue is this shows up in the jupyter output tab:

LSP Notebooks experiment is disabled -- not in treatment group

If you see that, you should switch to the Jupyter prerelease version.

rchiodo avatar Nov 07 '22 20:11 rchiodo

I have discovered that disabling the Pylance extension from within VSCode fixes it. I still get the suggestions from the Language Protocol.

I might be totally wrong, but I think this started after the Python extension was "decoupled" and Pylance and isort became separate ones.

rgriva avatar Nov 15 '22 18:11 rgriva

I've tried some of the solutions above, but this bug still exists. My solution is to keep both notebook and python files opened in workplace, and restart vscode, then only one language server started.

Fadelis98 avatar Nov 17 '22 04:11 Fadelis98

@raulguarini, @Fadelis98, have you tried the pre-release version of the Jupyter extension?

debonte avatar Nov 17 '22 23:11 debonte

@raulguarini, @Fadelis98, have you tried the pre-release version of the Jupyter extension?

Not yet, I'll try it later

Fadelis98 avatar Nov 18 '22 04:11 Fadelis98

I haven’t tried it either. Is there a specific bug fix coming?

On Thu, Nov 17, 2022 at 10:46 PM Fadelis98 @.***> wrote:

@raulguarini https://github.com/raulguarini, @Fadelis98 https://github.com/Fadelis98, have you tried the pre-release version of the Jupyter extension?

Not yet, I'll try it later

— Reply to this email directly, view it on GitHub https://github.com/microsoft/pylance-release/issues/3042#issuecomment-1319537015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6IBF34ARFWJARHC3ZBWIDWI4CZJANCNFSM53RQIN4A . You are receiving this because you were mentioned.Message ID: @.***>

rgriva avatar Nov 18 '22 14:11 rgriva

There was an issue with similar behavior that was fixed in the Jupyter extension recently. Please try their latest pre-release build and see if that fixes this for you.

debonte avatar Nov 18 '22 17:11 debonte

I'm also hitting this error. I tried the jupyter pre-release build and it's entirely broken for me: (edit: likely from https://github.com/microsoft/vscode-jupyter/issues/12200#issuecomment-1330937961)

[Extension Host] extension activation failed TypeError: s.notebooks.createNotebookControllerDetectionTask is not a function
	at h.startRefreshWithPython (/Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:2:2070921)
	at h.activate (/Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:2:2069968)
	at /Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:17:163983
	at Array.map (<anonymous>)
	at c.activateSync (/Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:17:163973)
	at /Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:2:1576749
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

kylebarron avatar Dec 08 '22 17:12 kylebarron

I'm also hitting this error. I tried the jupyter pre-release build and it's entirely broken for me: (edit: likely from microsoft/vscode-jupyter#12200 (comment))

[Extension Host] extension activation failed TypeError: s.notebooks.createNotebookControllerDetectionTask is not a function
	at h.startRefreshWithPython (/Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:2:2070921)
	at h.activate (/Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:2:2069968)
	at /Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:17:163983
	at Array.map (<anonymous>)
	at c.activateSync (/Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:17:163973)
	at /Users/kyle/.vscode/extensions/ms-toolsai.jupyter-2022.11.1003301027/out/extension.node.js:2:1576749
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

Jupyter prelease extension requires VS code insiders at the moment (at least until VS code stable catches up to it). It's using APIs that don't exist in the stable version of VS code.

rchiodo avatar Dec 08 '22 18:12 rchiodo

I was able to update to 1.74.0 (released today?) which fixed it without switching to the insiders build

kylebarron avatar Dec 08 '22 18:12 kylebarron