question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Command 'Python: Restart Language Server' resulted in an error (command 'python.analysis.restartLanguageServer' not found)

See original GitHub issue

Hello, there! I just saw the news in the release notes of 2020.8.101144: ‘Add “Restart Language Server” command.’ and was excited! This way I just got the notion about a completely new background Language Server, as a dedicated replacement for Jedi? 👍

I see that note about the new language server and the possible relation but this seems like a feature above the language server itself! So yes: If I set python.languageServer to Pylance there are other issues but I can restart with this command 👍

Now if it’s vscode-python that starts Jedi as a language server. That command should be able to restart it?

Environment data

  • VS Code version: 1.48.0
  • Extension version: 2020.8.101144
  • OS and version: Windows 10 Pro 2004
  • Python version: 2.7.18 / 3.8.4
  • Value of the python.languageServer setting: Jedi

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

Language Server restarts

Actual behaviour

Error message:

Command 'Python: Restart Language Server' resulted in an error (command 'python.analysis.restartLanguageServer' not found)

Steps to reproduce:

  1. Set language server to Jedi
  2. in command palette call Python: Restart Language Server

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
karthiknadigcommented, Feb 5, 2021

@JP01 Try this and see if it helps. Some times it is just a bad install. Looks like you might have a bad update. Do the following to remove stale versions of the extension:

  1. Uninstall Python extension (if you have pylance uninstall it first).
  2. Close all instances of VS Code.
  3. Go to, %USERPROFILE%/.vscode/extensions (on windows) or ~/.vscode/extensions on Linux/Mac.
  4. Delete any folder with the name starting with ms-python.python*
  5. Start VS Code, and install Python extension (also pylance if you uninstalled it in step 1).
1reaction
sloriacommented, Apr 5, 2021

Ah, after I re-created my virtualenv (I’m using pyenv+pyenv-virtualenv), restarted VS Code, then re-selected the interpreter using Python: Select Interpreter, the issue is resolved for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eclipse/openvsx - Gitter
I currently work at Coder and we maintain code-server, which is an open-source ... Restart Language Server' resulted in an error (command 'python.analysis....
Read more >
Fixing VS Code Extension Errors - Python - CodeProject
Resolve VS Code extension errors by forcing a new download. ... Python.LanguageServer.deps.json) was not found: package: 'runtime.win-x64.
Read more >
How fix Python import error in VS Code editor when using a ...
restart the Python Language Server with Ctrl+Shift+P > Python: Restart Language Server . Note that you do not need to rebuild the container....
Read more >
Pylance Is a New Python Language Server for Visual Studio ...
Microsoft has announced Pylance, a new language server for Python aimed to help programmers write better Python code and improve ...
Read more >
Default Keybindings - VSpaceCode
f l, Change file language, command, workbench.action.editor.changeLanguageMode ... Python. Key Binding: ␣ m languageId:python. Type: bindings ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found