vscode-python: The Python language server not starting in VSCode
Environment data
- Language Server version: v2023.4.40
- OS and version: MacOS version 13.3.1 (22E261)
- Python version (& distribution if applicable, e.g. Anaconda): Python2.7, Python3.9
Code Snippet
XXX
Repro Steps
- Remove all extensions
- Install the Python extension
- Set the interpreter path by whatever Python version
- Open a Python file with some codes
- Can’t see the Python language server in the OUTPUT dropdown
Expected behavior
- After installing the Python extension, the Pylance extension will be installed automatically.
- I will see the Python language server option in the OUTPUT dropdown list after I open a Python file.
- I can take the features that the Pylance provides such as Go to definition.
Actual behavior
- After installing the Python extension, the Pylance extension will be installed automatically.
- I can’t see the Python language server option in the OUTPUT dropdown list after I open a Python file.
- I can’t take the features that the Pylance provides such as Go to definition.
Logs
Experiment 'pythonPromptNewFormatterExtcf' is active
Experiment 'pythonPromptNewToolsExt' is active
> conda info --json
> ~/.local/share/virtualenvs/event_setting-12S3pxxF/bin/python -I ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/practice_in_2022-WqINlCuK/bin/python -I ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/interpreterInfo.py
> ~/.local/share/virtualenvs/video_downloader-GHe3XpYG/bin/python -I ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/interpreterInfo.py
Python interpreter path: ~/.local/share/virtualenvs/event_setting-12S3pxxF/bin/python
> . ~/.local/share/virtualenvs/event_setting-12S3pxxF/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2023.6.1/pythonFiles/printEnvVariables.py
shell: bash
Send text to terminal: source /Users/lillard/.local/share/virtualenvs/event_setting-12S3pxxF/bin/activate
VSCode settings
Even I set both the user and workspace settings to an empty Json {}
The Python language server won’t start up too.
User settings
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[python]": {
"editor.defaultFormatter": "ms-python.python",
"editor.formatOnType": true
},
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"editor.mouseWheelZoom": true,
"java.semanticHighlighting.enabled": true,
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"java.home": "/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home",
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home",
"default": true,
},
],
"angular.experimental-ivy": true,
"workbench.editorAssociations": {
"*.ipynb": "jupyter-notebook"
},
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"python.testing.pytestEnabled": true,
"code-runner.runInTerminal": true,
"redhat.telemetry.enabled": true,
"terminal.integrated.defaultProfile.osx": "bash",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"python.linting.pylintEnabled": true,
"omnisharp.useEditorFormattingSettings": false,
"python.formatting.provider": "black",
"editor.copyWithSyntaxHighlighting": false,
"window.zoomLevel": 1,
"json-to-go.inputSource": "clipboard",
"python.linting.banditEnabled": true,
"python.linting.banditPath": "/Library/Frameworks/Python.framework/Versions/3.10/bin/bandit",
"diffEditor.ignoreTrimWhitespace": false,
"editor.inlineSuggest.enabled": true,
"tabnine.experimentalAutoImports": true,
"python.analysis.diagnosticMode": "workspace",
"python.languageServer": "Pylance",
"python.jediEnabled": false,
"python.analysis.logLevel": "Trace",
}
Workspace settings.json
{
"python.envFile": "${workspaceFolder}/.env",
"python.languageServer": "Default",
"python.analysis.logLevel": "Trace"
}
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 25 (5 by maintainers)
@karrtikr The first post I did is using python3.9 and I also provided the workspace settings.json there, please take a look, thank you!