microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

Error: command 'pyright.createtypestub' already exists #2765

Closed shaunm-msft closed 10 months ago

shaunm-msft commented 2 years ago

[Info - 7:56:43 AM] (46164) Pylance language server 2022.4.4-pre.1 (pyright 88f2a424) starting [Info - 7:56:43 AM] (46164) Server root directory: c:\Users\shaunm.vscode-insiders\extensions\ms-python.vscode-pylance-2022.4.4-pre.1\dist [Error - 7:56:43 AM] Server initialization failed. Error: command 'pyright.createtypestub' already exists at o.registerCommand (c:\Users\shaunm\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:29716) at Object.registerCommand (c:\Users\shaunm\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:30972) at t.ExecuteCommandFeature.register (c:\Users\shaunm.vscode-insiders\extensions\ms-python.python-2022.5.11231003\out\client\extension.js:2:2220058) at t.ExecuteCommandFeature.initialize (c:\Users\shaunm.vscode-insiders\extensions\ms-python.python-2022.5.11231003\out\client\extension.js:2:2219637) at S.initializeFeatures (c:\Users\shaunm.vscode-insiders\extensions\ms-python.python-2022.5.11231003\out\client\extension.js:2:2172202) at S.doInitialize (c:\Users\shaunm.vscode-insiders\extensions\ms-python.python-2022.5.11231003\out\client\extension.js:2:2160126) at async S.start (c:\Users\shaunm.vscode-insiders\extensions\ms-python.python-2022.5.11231003\out\client\extension.js:2:2157141) at async f.start (c:\Users\shaunm.vscode-insiders\extensions\ms-python.python-2022.5.11231003\out\client\extension.js:2:34030) [Error - 7:56:43 AM] Python Tools client: couldn't create connection to server.

judej commented 2 years ago

Thanks for the report. This can happen if Pyright and Pylance extensions are both installed. Is this the case for you? If so, could you please uninstall one of them?

debonte commented 2 years ago

Discussed this with Eric today. When both Pyright and Pylance are installed, Pyright will detect that Pylance is present and disable itself. Best guess is that this exception happens in cases where Pyright is already installed and the user installs Pylance after Pyright has activated.

In any case, nothing has changed with this logic on our side recently. But there has clearly been a change in behavior since we've seen this exception in our stack traces over the past couple weeks and now a user has reported it.

Our theory is that the LSP 3.17 upgrade included a change to throw an exception when an extension attempts to register an already registered command, whereas it used to be silent. Plan is to just catch the exception.

shaunm-msft commented 2 years ago

I have the Pylance extension installed but not the Pyright extension. That is to say, the pyright extension doesn't appear in the list of installed extensions and it doesn't appear in the list of running extensions.

debonte commented 2 years ago

I have the Pylance extension installed but not the Pyright extension.

Wow, ok. Can you send us a list of the extensions you have installed? You can dump the list of extensions on the command line using code --list-extensions

shaunm-msft commented 2 years ago

E:>code-insiders --list-extensions ms-dotnettools.vscode-dotnet-runtime ms-python.python ms-python.vscode-pylance ms-toolsai.jupyter ms-toolsai.jupyter-keymap ms-toolsai.jupyter-renderers ms-vscode-remote.remote-wsl ms-vscode.cpptools ms-vscode.powershell-preview VisualStudioExptTeam.intellicode-api-usage-examples VisualStudioExptTeam.vscodeintellicode-completions VisualStudioExptTeam.vscodeintellicode-insiders

Sanqui commented 2 years ago

Also ran into this problem today after setting up a new VS Code instance and syncing my settings. Here's my list of extensions:

sanqui@myrtus ~> code --list-extensions
eamodio.gitlens
gerane.Theme-Cobalt
HookyQR.beautify
jock.svg
ms-azuretools.vscode-docker
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-ssh-edit
ms-vscode.cpptools
RandomFractalsInc.vscode-data-preview
RoscoP.fastbuild
samuelcolvin.jinjahtml
svelte.svelte-vscode
wesbos.theme-cobalt2

Version: Pylance language server 2022.4.3 (pyright 88f2a424)

Finerestaurant commented 2 years ago

I also head same probelm after changing conda virtual environment. Here's my extension lists.

(base) C:\Users\user>code --list-extensions cschlosser.doxdocgen Equinusocio.vsc-community-material-theme Equinusocio.vsc-material-theme equinusocio.vsc-material-theme-icons jeff-hykin.better-cpp-syntax ms-python.python ms-python.vscode-pylance ms-toolsai.jupyter ms-toolsai.jupyter-keymap ms-toolsai.jupyter-renderers ms-vscode-remote.remote-containers ms-vscode-remote.remote-ssh ms-vscode-remote.remote-ssh-edit ms-vscode-remote.remote-wsl ms-vscode.cmake-tools ms-vscode.cpptools ms-vscode.cpptools-extension-pack ms-vscode.cpptools-themes oderwat.indent-rainbow twxs.cmake

arsenie-ciobanu-cko commented 2 years ago

Same thing here - just installed VS Code and getting this error:

[Error - 3:47:25 PM] Pylance client: couldn't create connection to server.
Error: command 'pyright.createtypestub' already exists

Version: Pylance language server 2022.4.3 (pyright 88f2a424)

here's my extensions list:

user@xxx ~ % code --list-extensions
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
55octet commented 2 years ago

Same issue:

code --list-extensions
eamodio.gitlens
michelemelluso.gitignore    
ms-python.python
ms-python.vscode-pylance    
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap   
ms-toolsai.jupyter-renderers
thomas-oconnell commented 2 years ago

Reverting to Python extension version 2022.4.1 from 2022.6.0 resolved this issue for me, though your mileage may vary. I did not touch the Pylance extension version.

With version 2022.6.0, the issue wouldn't appear as long as I had a project folder open and contained my work in that regard.

With version 2022.4.1, the issue was gone, regardless of my current working status.

Edit: corrected "very" to "vary" - long workdays :)

netcore-jroger commented 2 years ago

Reverting to Python extension version 2022.4.1 from 2022.6.0 resolved this issue for me, though your mileage may very. I did not touch the Pylance extension version.

With version 2022.6.0, the issue wouldn't appear as long as I had a project folder open and contained my work in that regard.

With version 2022.4.1, the issue was gone, regardless of my current working status.

how to download 2022.4.1 version.

thomas-oconnell commented 2 years ago

Reverting to Python extension version 2022.4.1 from 2022.6.0 resolved this issue for me, though your mileage may very. I did not touch the Pylance extension version. With version 2022.6.0, the issue wouldn't appear as long as I had a project folder open and contained my work in that regard. With version 2022.4.1, the issue was gone, regardless of my current working status.

how to download 2022.4.1 version.

Click on the extension within VS Code, click the arrow next to Uninstall, then "Install Another Version..."

Angshuman-Maity commented 2 years ago

I was also facing the same issue. Reverting back to Python extension version 2022.4.1 from 2022.6.0 resolved this issue for me. Thank you .

erictraut commented 2 years ago

Thanks for the update. Based on these clues, this looks like it's probably a regression in the core Python extension. I wonder if the Python extension is unloading and then reloading Pylance but doing so in a way that the command 'pyright.createtypestub' isn't unregistered upon unload.

BobDenny commented 2 years ago

Same here, reverted to 2022.4.1 cured it also. Thank you @thomas-oconnell

> code --list-extensions
aaron-bond.better-comments
Cameron.vscode-pytest
DavidAnson.vscode-markdownlint
dawhite.mustache
dbaeumer.vscode-eslint
donjayamanne.python-environment-manager
DotJoshJohnson.xml
eamodio.gitlens
Equinusocio.vsc-material-theme
equinusocio.vsc-material-theme-icons
formulahendry.code-runner
ms-python.python
ms-python.vscode-pylance
nico-castell.linux-desktop-file
njpwerner.autodocstring
rangav.vscode-thunder-client
redhat.vscode-yaml
slightc.pip-manager
tomblind.local-lua-debugger-vscode
tomoki1207.pdf
trond-snekvik.simple-rst
trinatek commented 2 years ago

Samesies:

code --list-extensions
akamud.vscode-theme-onedark
almenon.arepl
arcsector.vscode-splunk-search-linter
arcsector.vscode-splunk-search-syntax
cantonios.project-templates
DotJoshJohnson.xml
emilast.LogFileHighlighter
formulahendry.auto-rename-tag
KevinRose.vsc-python-indent
mgesbert.python-path
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-vscode-remote.remote-wsl
ms-vscode.powershell
PKief.material-icon-theme
PrateekMahendrakar.prettyxml
richie5um2.vscode-sort-json
ryuta46.multi-command
seanwu.vscode-qt-for-python
Splunk.splunk
stkb.rewrap
vscodevim.vim
zhuangtongfa.material-theme
Zignd.html-css-class-completion

I can also report that switching back to VS Code Python Extension v2022.04.01 resolved the issue for the time-being. (Right-click the extension on the VSCode side bar -> 'Install Another Version...' )

shendin-chrobinson commented 2 years ago

I have experienced the same today, and downgrading the core Python extension to v2022.4.1 fixed it for me.

zachsiegel-capsida commented 2 years ago

Same issue, reverting Python core version solved it for me too.

BobDenny commented 2 years ago

I just updated to the 2022.7.11291008 Pre-Release version and the problem is also gone.

progrunman commented 2 years ago

I'm also v2022.6.0 and the problem occurred after moving the source folder of the existing project. The problem went away when I restarted VSCode after a few minutes. However, the warning below is still occurring.

[Warn] (14348) stubPath 'my project folder path'\typings is not a valid directory.

The 'typings' folder was not created by me and does not exist in the my source folder. So, I don't know what that is.

Kein commented 2 years ago

Same issue. I have 3 versions of Python installed, 3.9.6, 3.10 and 3.8.5 but only switching to 3.8.5 causes this issue.

edwardchoijc commented 2 years ago

Same issue. My full log is below.

[Info - 11:30:50 AM] (78228) Pylance language server 2022.4.3 (pyright 88f2a424) starting [Info - 11:30:50 AM] (78228) Server root directory: /HOME_PATH/.vscode/extensions/ms-python.vscode-pylance-2022.4.3/dist [Warn - 11:30:50 AM] (78228) stubPath /MY_PROJECT_PATH/typings is not a valid directory. [Info - 11:31:08 AM] (78246) Pylance language server 2022.4.3 (pyright 88f2a424) starting [Info - 11:31:08 AM] (78246) Server root directory: /HOME_PATH/.vscode/extensions/ms-python.vscode-pylance-2022.4.3/dist [Error - 11:31:08 AM] Server initialization failed. Error: command 'pyright.createtypestub' already exists at o.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:29716) at Object.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:30972) at t.ExecuteCommandFeature.register (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2221856) at t.ExecuteCommandFeature.initialize (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2221435) at S.initializeFeatures (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2174000) at S.doInitialize (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2161924) at async S.start (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2158939) at async S.$start (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2165739) at async t.Delayer. (/HOME_PATH/.vscode/extensions/ms-python.python-2022.6.1/out/client/extension.js:2:2164010) [Error - 11:31:08 AM] Pylance client: couldn't create connection to server.

Extensions:

code --list-extensions 2gua.rainbow-brackets aaron-bond.better-comments alefragnani.project-manager DotJoshJohnson.xml eamodio.gitlens Equinusocio.vsc-community-material-theme Equinusocio.vsc-material-theme equinusocio.vsc-material-theme-icons GrapeCity.gc-excelviewer KevinRose.vsc-python-indent Lencerf.beancount mhutchie.git-graph MS-CEINTL.vscode-language-pack-zh-hans ms-python.python ms-python.vscode-pylance ms-toolsai.jupyter ms-toolsai.jupyter-keymap ms-toolsai.jupyter-renderers ms-vscode-remote.remote-wsl njpwerner.autodocstring Shan.code-settings-sync Tyriar.sort-lines vscode-icons-team.vscode-icons

And I found a very strange problem, that is, with the same environment, only some projects had this situation, which is the other projects had not.

daydaychen commented 2 years ago

I switch to Python extension pre-release v2022.7.11311004, all of ok.

gakubuchi commented 2 years ago

I have the same issue (and also some of my students). The list of extensions I have is:

C:\Users\xxxxxx>code --list-extensions
alexcvzz.vscode-sqlite
cschlosser.doxdocgen
enriquein.htmlentity-replacer
jeff-hykin.better-cpp-syntax
mborik.z80-macroasm
ms-azuretools.vscode-docker
ms-dotnettools.csharp
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
ms-vscode-remote.remote-containers
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-wsl
ms-vscode.cmake-tools
ms-vscode.cpptools
ms-vscode.cpptools-extension-pack
ms-vscode.cpptools-themes
sharksym.asm-msx
tht13.html-preview-vscode
twxs.cmake

I haven't tried to revert to an older version of Python extension. I hope it is useful Captura de pantalla 2022-05-12 113800 .

longguzzz commented 2 years ago

I have this problem after I set my defaultProfile with my self-configure commandline.

image

And I solve this problem by setting the terminal with the default one. (PowerShell)

image

monkeycc commented 2 years ago

vscode 1.67.1

[Info  - 16:06:07] (8668) Pylance language server 2022.5.1 (pyright e0e07d31) starting
[Info  - 16:06:07] (8668) Server root directory: c:\Users\MM\.vscode\extensions\ms-python.vscode-pylance-2022.5.1\dist
[Error - 16:06:07] Server initialization failed.
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (c:\Users\MM\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:29716)
    at Object.registerCommand (c:\Users\MM\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2224760)
    at S.initializeFeatures (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2176688)
    at S.doInitialize (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2164589)
    at async S.start (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2161604)
    at async h.start (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:33669)
[Error - 16:06:07] Pylance client: couldn't create connection to server.
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (c:\Users\MM\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:29716)
    at Object.registerCommand (c:\Users\MM\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2224760)
    at S.initializeFeatures (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2176688)
    at S.doInitialize (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2164589)
    at async S.start (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2161604)
    at async h.start (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:33669)
[Error - 16:06:07] Sending notification textDocument/didOpen failed.
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (c:\Users\MM\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:29716)
    at Object.registerCommand (c:\Users\MM\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2224760)
    at S.initializeFeatures (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2176688)
    at S.doInitialize (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2164589)
    at async S.start (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:2161604)
    at async h.start (c:\Users\MM\.vscode\extensions\ms-python.python-2022.6.2\out\client\extension.js:2:33669)
[Error - 16:06:07] Sending notification textDocument/didOpen failed.
Error: command 'pyright.createtypestub' already exists
citron commented 2 years ago

Same problem here after a fresh installation of vscode and a sync with my other vscode configurations.

fritol commented 2 years ago

same here. removed all extensions. reinst VS code. Still the same problem. In addition cannot run python files in the terminal only notebook exec works! wtf!

strobelight commented 2 years ago

I also received same error when using OSX ssh to debug remotely, but noticed a reload was required of python extension, so did that, and the error went away.

python v2022.6.2 pylance v2022.5.1

TaridaGeorge commented 2 years ago

For me, I think that this error started to occur after I installed pyright by mistake without knowing that pylance has it already in it and after I've uninstalled the pyright extension I started to notice this error. So I guess that someone could test this case: Make a fresh install of VSCode - don't sync nothing - install pylance - install pyright - uninstall pyright see if the error shows up.

netcore-jroger commented 2 years ago

DO NOT INSTALL THIS.

图片

INSTALL THIS:

图片

omidshojaee commented 2 years ago

Had this issue and solved it by reverting to 2022.7.11381657 and then installing the latest pre-release (2022.7.11381925) again.

chausner-audeering commented 2 years ago

I switch to Python extension pre-release v2022.7.11311004, all of ok.

I think I started to run into this issue after the vscode update today from 1.67.1 to 1.67.2. Installing the pre-release version of the Python extension also fixed it for me.

ghost commented 2 years ago

Had this issue and solved it by reverting to 2022.7.11381657 and then installing the latest pre-release (2022.7.11381925) again.

This worked for me, thank you so much 😄

khurchla commented 2 years ago

I had this error but it went away after I did the following then restarted VSCode. (possibly a restart of VSCode alone would have done it)

this is what I had installed when it first occurred:

Elypha commented 2 years ago

for my case, I have to revert Python to v2022.4.1 and Pylance to v2022.4.3 as well

hope that helps

zptang1210 commented 2 years ago

I am also experiencing this problem on both my Windows and MacOS computers.

ingmarschuster commented 2 years ago

For me also: Reverting to Python extension version 2022.4.1 resolved the problem

dziyaee commented 2 years ago

Same issue here, completely fresh install of vscode. Only happens the first time when I try to switch the Python interpreter to different conda envs.

$ code --list-extensions --show-versions
ms-python.python@2022.6.2
ms-python.vscode-pylance@2022.5.3
ms-toolsai.jupyter@2022.4.1021342353
ms-toolsai.jupyter-keymap@1.0.0
ms-toolsai.jupyter-renderers@1.0.7
ms-vscode.Theme-PredawnKit@0.1.4

Also getting a whole bunch of errors in the output

[Info  - 11:11:18 PM] (70156) Pylance language server 2022.5.3 (pyright 73c82fab) starting
[Info  - 11:11:18 PM] (70156) Server root directory: /Users/foo/.vscode/extensions/ms-python.vscode-pylance-2022.5.3/dist
Notebook support: Legacy
[Info  - 11:11:18 PM] (70156) No pyproject.toml file found.
[Info  - 11:11:18 PM] (70156) Setting pythonPath for service "<default>": "/usr/local/bin/python3"
[Warn  - 11:11:18 PM] (70156) stubPath typings is not a valid directory.
[Info  - 11:11:18 PM] (70156) Assuming Python version 3.8
[Info  - 11:11:18 PM] (70156) Assuming Python platform Darwin
[Info  - 11:11:19 PM] (70156) Searching for source files
[Info  - 11:11:19 PM] (70156) No source files found.
[Info  - 11:11:19 PM] (70156) No pyproject.toml file found.
[Info  - 11:11:19 PM] (70156) Setting pythonPath for service "<default>": "/usr/local/bin/python3"
[Warn  - 11:11:19 PM] (70156) stubPath typings is not a valid directory.
[Info  - 11:11:19 PM] (70156) Assuming Python version 3.8
[Info  - 11:11:19 PM] (70156) Assuming Python platform Darwin
[Info  - 11:11:19 PM] (70156) Searching for source files
[Info  - 11:11:19 PM] (70156) No source files found.
[Info  - 11:11:20 PM] (70156) Background analysis(1) root directory: /Users/foo/.vscode/extensions/ms-python.vscode-pylance-2022.5.3/dist
[Info  - 11:11:20 PM] (70156) Background analysis(1) started
[Error - 11:12:24 PM] Stopping server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 11:12:25 PM] (70235) Pylance language server 2022.5.3 (pyright 73c82fab) starting
[Info  - 11:12:25 PM] (70235) Server root directory: /Users/foo/.vscode/extensions/ms-python.vscode-pylance-2022.5.3/dist
[Info  - 11:12:25 PM] (70236) Pylance language server 2022.5.3 (pyright 73c82fab) starting
[Info  - 11:12:25 PM] (70236) Server root directory: /Users/foo/.vscode/extensions/ms-python.vscode-pylance-2022.5.3/dist
Notebook support: Legacy
Notebook support: Legacy
[Error - 11:12:25 PM] Server initialization failed.
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:29716)
    at Object.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2224760)
    at S.initializeFeatures (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2176688)
    at S.doInitialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2164589)
    at async S.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2161604)
    at async h.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:33669)
[Error - 11:12:25 PM] Pylance client: couldn't create connection to server.
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:29716)
    at Object.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2224760)
    at S.initializeFeatures (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2176688)
    at S.doInitialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2164589)
    at async S.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2161604)
    at async h.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:33669)
[Error - 11:12:25 PM] Sending notification textDocument/didOpen failed.
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:29716)
    at Object.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2224760)
    at S.initializeFeatures (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2176688)
    at S.doInitialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2164589)
    at async S.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2161604)
    at async h.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:33669)
[Error - 11:12:25 PM] Sending document notification textDocument/didOpen failed
Error: command 'pyright.createtypestub' already exists
    at o.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:29716)
    at Object.registerCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:30972)
    at t.ExecuteCommandFeature.register (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2225181)
    at t.ExecuteCommandFeature.initialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2224760)
    at S.initializeFeatures (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2176688)
    at S.doInitialize (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2164589)
    at async S.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:2161604)
    at async h.start (/Users/foo/.vscode/extensions/ms-python.python-2022.6.2/out/client/extension.js:2:33669)
[Info  - 11:12:26 PM] (70235) No pyproject.toml file found.
[Info  - 11:12:26 PM] (70235) Setting pythonPath for service "<default>": "/Users/foo/miniconda3/envs/prime/bin/python"
[Warn  - 11:12:26 PM] (70235) stubPath typings is not a valid directory.
[Info  - 11:12:26 PM] (70235) Assuming Python version 3.10
[Info  - 11:12:26 PM] (70235) Assuming Python platform Darwin
[Info  - 11:12:26 PM] (70235) Searching for source files
[Info  - 11:12:26 PM] (70235) No source files found.
[Info  - 11:12:27 PM] (70235) Background analysis(1) root directory: /Users/foo/.vscode/extensions/ms-python.vscode-pylance-2022.5.3/dist
[Info  - 11:12:27 PM] (70235) Background analysis(1) started
[Info  - 11:12:27 PM] (70235) No pyproject.toml file found.
[Info  - 11:12:27 PM] (70235) Setting pythonPath for service "<default>": "/Users/foo/miniconda3/envs/prime/bin/python"
[Warn  - 11:12:27 PM] (70235) stubPath typings is not a valid directory.
[Info  - 11:12:27 PM] (70235) Assuming Python version 3.10
[Info  - 11:12:27 PM] (70235) Assuming Python platform Darwin
[Info  - 11:12:27 PM] (70235) Searching for source files
[Info  - 11:12:27 PM] (70235) No source files found.

I can confirm that downgrading to ms-python.python@2022.4.1 fixed it.

spectatorzhang commented 2 years ago

image

fritol commented 2 years ago

same old same old image

spectatorzhang commented 2 years ago

Seems like this issue has been solved after Python extension releases 2022.6.3 upgrade. image

meflouu commented 2 years ago

At least for me, the issue persists. In fact, I just got here after updating to 2022.6.3

Seems like this issue has been solved after Python extension releases 2022.6.3 upgrade. image

debonte commented 2 years ago

Yes, it's still happening in the latest build of the Python extension. We're actively looking at this.

spectatorzhang commented 2 years ago

The problem may be with Python extension, not Pylance itself.

Yes, it's still happening in the latest build of the Python extension. We're actively looking at this.

debonte commented 2 years ago

The problem may be with Python extension, not Pylance itself.

Yes, it's an issue with the way that Python is managing the LSP connection with Pylance. But the Pylance team is driving the investigation, so it makes sense for the issue to stay on our issue tracker.

lind-ric commented 2 years ago

Hoping this gets resolved soon! best of luck to the mega minds working on this!!

RuimanDiaz commented 2 years ago

Is the Python and Pylance extension, disable one.

heejaechang commented 2 years ago

this will be fixed in python extension once new version is released.

babrar commented 2 years ago

This issue still persists in version 2022.8.1 -> latest release version as of Jul 5, 2022

I can confirm that downgrading to ms-python.python@2022.4.1 fixed it.