您现在的位置是:首页 >其他 >VScode启动报错:Error: command ‘pyright.createtypestub‘ already exists网站首页其他
VScode启动报错:Error: command ‘pyright.createtypestub‘ already exists
新安装了vscode,启动时报错,
2023-05-15 09:12:19.064 [info] [Info - 9:12:19 AM] (7176) Pylance language server 2023.5.20 (pyright 009aef31) starting
2023-05-15 09:12:19.064 [info] [Info - 9:12:19 AM] (7176) Server root directory: c:UsersAdministrator.vscodeextensionsms-python.vscode-pylance-2023.5.20dist
2023-05-15 09:12:19.065 [info] [Info - 9:12:19 AM] (7176) Starting service instance "yolov5602DCode"
2023-05-15 09:12:19.065 [info] [Info - 9:12:19 AM] (11000) Pylance language server 2023.5.20 (pyright 009aef31) starting
2023-05-15 09:12:19.065 [info] [Info - 9:12:19 AM] (11000) Server root directory: c:UsersAdministrator.vscodeextensionsms-python.vscode-pylance-2023.5.20dist
2023-05-15 09:12:19.071 [info] [Info - 9:12:19 AM] (11000) Starting service instance "yolov5602DCode"
2023-05-15 09:12:19.073 [info] [Error - 9:12:19 AM] Server initialization failed.
2023-05-15 09:12:19.073 [info] Error: command 'pyright.createtypestub' already exists
at e.ExtHostCommands.registerCommand (c:ProgramsMicrosoftVSCode
esourcesappoutvsworkbenchapi
odeextensionHostProcess.js:98:123788)
at Object.registerCommand (c:ProgramsMicrosoftVSCode
esourcesappoutvsworkbenchapi
odeextensionHostProcess.js:116:23226)
at t.ExecuteCommandFeature.register (c:UsersAdministrator.vscodeextensionsms-python.python-2023.8.0outclientextension.js:2:2106221)
at t.ExecuteCommandFeature.initialize (c:UsersAdministrator.vscodeextensionsms-python.python-2023.8.0outclientextension.js:2:2105800)
at S.initializeFeatures (c:UsersAdministrator.vscodeextensionsms-python.python-2023.8.0outclientextension.js:2:2057711)
at S.doInitialize (c:UsersAdministrator.vscodeextensionsms-python.python-2023.8.0outclientextension.js:2:2045260)
at async S.start (c:UsersAdministrator.vscodeextensionsms-python.python-2023.8.0outclientextension.js:2:2042275)
at async h.start (c:UsersAdministrator.vscodeextensionsms-python.python-2023.8.0outclientextension.js:2:37203)
搜索了一下,发现是vscode扩展版本引起的问题,
参考地址如下,
解决办法:
把vscode的python-extension降级到Python extension version 2022.4.1就OK了。