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

Pylance client: couldn't create connection to server.

Open adrianrymill opened this issue 1 year ago • 4 comments

Environment data

  • Pylance version: v2024.9.1
  • OS and version: Windows 11 Home 23H2
  • Python version (& distribution if applicable, e.g. Anaconda): Microsoft v2024.15.2024091301 (pre-release)
2024-09-16 18:32:40.085 [info] (Client) Pylance async client (2024.9.1) started with python extension (2024.14.1)
2024-09-16 18:32:40.115 [info] [Error - 6:32:40 PM] Pylance client: couldn't create connection to server.
2024-09-16 18:32:40.115 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT
2024-09-16 18:37:21.205 [info] (Client) Pylance async client (2024.9.1) started with python extension (2024.15.2024091301)
2024-09-16 18:37:21.222 [info] [Error - 6:37:21 PM] Pylance client: couldn't create connection to server.
2024-09-16 18:37:21.223 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT
2024-09-16 18:46:20.321 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.15.2024091301)
2024-09-16 18:46:20.339 [info] [Error - 6:46:20 PM] Pylance client: couldn't create connection to server.
2024-09-16 18:46:20.339 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT
2024-09-16 18:46:36.873 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.15.2024091301)
2024-09-16 18:46:36.888 [info] [Error - 6:46:36 PM] Pylance client: couldn't create connection to server.
2024-09-16 18:46:36.888 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT
2024-09-16 18:47:47.298 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.14.1)
2024-09-16 18:47:47.314 [info] [Error - 6:47:47 PM] Pylance client: couldn't create connection to server.
2024-09-16 18:47:47.314 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT

Repro Steps

  1. XXX

I'm expeciting Pylance to work.

XXX

Instead if does not work and gives the error message :Pylance client: couldn't create connection to server.

Logs

XXX

adrianrymill avatar Sep 16 '24 10:09 adrianrymill

I've tried using Copilot to fix the issue. I've tried all the below and no success so far.

  1. Reload Visual Studio Code
  2. Check Pylance is installed and up to date.
  3. Check VS Code is up to date.
  4. Restart VS Code.
  5. Re-installed VS Code.
  6. {} settings.json only contains the below { "python.REPL.enableREPLSmartSend": false }
  7. Run VS Code as an admin
  8. Deleted the pylance files in C:\Users\user_name.vscode\extensions .. and then re-installed Pylance

adrianrymill avatar Sep 16 '24 10:09 adrianrymill

Output lists the below: 2024-09-16 18:32:40.085 [info] (Client) Pylance async client (2024.9.1) started with python extension (2024.14.1) 2024-09-16 18:32:40.115 [info] [Error - 6:32:40 PM] Pylance client: couldn't create connection to server. 2024-09-16 18:32:40.115 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT 2024-09-16 18:37:21.205 [info] (Client) Pylance async client (2024.9.1) started with python extension (2024.15.2024091301) 2024-09-16 18:37:21.222 [info] [Error - 6:37:21 PM] Pylance client: couldn't create connection to server. 2024-09-16 18:37:21.223 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT 2024-09-16 18:46:20.321 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.15.2024091301) 2024-09-16 18:46:20.339 [info] [Error - 6:46:20 PM] Pylance client: couldn't create connection to server. 2024-09-16 18:46:20.339 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT 2024-09-16 18:46:36.873 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.15.2024091301) 2024-09-16 18:46:36.888 [info] [Error - 6:46:36 PM] Pylance client: couldn't create connection to server. 2024-09-16 18:46:36.888 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT 2024-09-16 18:47:47.298 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.14.1) 2024-09-16 18:47:47.314 [info] [Error - 6:47:47 PM] Pylance client: couldn't create connection to server. 2024-09-16 18:47:47.314 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT 2024-09-16 18:52:23.057 [info] (Client) Pylance async client (2024.9.100) started with python extension (2024.14.1) 2024-09-16 18:52:23.078 [info] [Error - 6:52:23 PM] Pylance client: couldn't create connection to server. 2024-09-16 18:52:23.078 [info] Launching server using command editor.hover.enabled failed. Error: spawn editor.hover.enabled ENOENT

adrianrymill avatar Sep 16 '24 11:09 adrianrymill

@adrianrymill, how are you running VS Code? Is the server remote? In a container?

debonte avatar Sep 20 '24 01:09 debonte

Hello, I am running it on my PC at home. HP Slim Desktop S01-pF0xxx Processor Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz 2.90 GHz Installed RAM 8.00 GB (7.89 GB usable) System type 64-bit operating system, x64-based processor

adrianrymill avatar Sep 25 '24 09:09 adrianrymill

I have the same problem running in a devcontainer.

code

{
	"name": "Demo",
	"dockerFile": "Dockerfile",
	"context": "..",
	"runArgs": [
		"--network",
		"host",
		"--env-file",
		".devcontainer/.env"
	],
	"postCreateCommand": "make install && echo 'Welcome!! Ya puedes trabajar'",
	"customizations": {
		"vscode": {
			"settings": {
				"python.languageServer": "Pylance",
				"terminal.integrated.shell.linux": "/bin/bash",
				"python.defaultInterpreterPath": "/home/vscode/venv/bin/python",
				"python.analysis.autoSearchPaths": true,
				"python.analysis.typeCheckingMode": "strict",
				"python.analysis.autoImportCompletions": true,
				"python.analysis.languageServerMode": "full",
				"python.linting.enabled": true,
				"python.linting.mypyEnabled": true,
				"python.linting.pylintEnabled": false,
				"python.linting.flake8Enabled": false,
				"git.enabled": true,
				"git.autofetch": true,
				"git.confirmSync": false
			},
			"extensions": [
				"ms-python.autopep8",
				"ms-python.black-formatter",
				"ms-python.debugpy",
				"ms-python.isort",
				"ms-python.python",
				"ms-python.vscode-pylance",
				"streetsidesoftware.code-spell-checker"
			]
		}
	},
	"remoteUser": "vscode"
}```

njavilas avatar Apr 05 '25 14:04 njavilas

2025-04-05 14:37:15.646 [info] (Client) Running with node: /home/vscode/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist/.cache/node/node 2025-04-05 14:37:16.379 [info] (Client) Pylance async client (2025.4.1) started with python extension (2025.4.0) 2025-04-05 14:37:16.749 [info] [Error - 2:37:16 PM] Pylance client: couldn't create connection to server. 2025-04-05 14:37:16.749 [info] Launching server using command /home/vscode/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist/.cache/node/node failed. Error: spawn /home/vscode/.vscode-server/extensions/ms-python.vscode-pylance-2025.4.1/dist/.cache/node/node ENOENT

njavilas avatar Apr 05 '25 14:04 njavilas