Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylance not starting in specific projects #24852

Open
bruecksen opened this issue Feb 27, 2025 · 15 comments
Open

Pylance not starting in specific projects #24852

bruecksen opened this issue Feb 27, 2025 · 15 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@bruecksen
Copy link

Pylance is not starting in certain projects. In these projects, the Pylance server does not start at all (see attached logs). As a result:

  • All pylance features are not working.
  • The Python Language Server option is missing from the Output panel.
  • Pylance-specific commands (e.g., Pylance: Start Logging) fail with command not found.

I have tried several troubleshooting steps, including:

  • Selecting the correct Python interpreter.
  • Creating new virtual environments.
  • Using a virtual environment from a working project.
  • Setting up a new project from scratch.
  • Using django-cookiecutter as a template.
  • Despite these efforts, Pylance still does not start.

I have several older projects where Pylance works as expected, indicating that the issue is project-specific rather than system-wide.

Environment data

  • Pylance version: 2025.2.101
  • Vscode Version: 1.97.2 (Universal)
  • OS and version: Osx 14.5
  • Python version (& distribution if applicable, e.g. Anaconda): Python3.13

Repro Steps

  1. Create a clean project.
  2. Create a virtual environment.
  3. Select the virtual environment as the Python interpreter.
  4. Install Django as a dependency.
  5. Create a test.py file and import django.models.
  6. Try using Go to Definition on the import.

Logs

Python Output (Pylance not working)
2025-02-27 19:53:11.011 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-02-27 19:53:11.011 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-02-27 19:53:11.011 [info] Experiment 'pythonTestAdapter' is active
2025-02-27 19:53:11.011 [info] Native locator: Refresh started
2025-02-27 19:53:11.011 [info] Native locator: Refresh started
2025-02-27 19:53:11.061 [info] Python interpreter path: ~/.virtualenvs/unbound-trajectories-wagtail-hQSuZdI_-py3.13/bin/python
Python Output (Pylance working)
2025-02-27 19:53:11.457 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-02-27 19:53:11.457 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-02-27 19:53:11.457 [info] Experiment 'pythonTestAdapter' is active
2025-02-27 19:53:11.457 [info] Native locator: Refresh started
2025-02-27 19:53:11.465 [info] > pyenv which python
2025-02-27 19:53:11.466 [info] cwd: .
2025-02-27 19:53:12.984 [info] Python interpreter path: ~/.virtualenvs/lifelessons/bin/python
2025-02-27 19:53:13.285 [info] > . ~/.virtualenvs/lifelessons/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2025.1.2025022501-darwin-arm64/python_files/printEnvVariables.py
2025-02-27 19:53:13.286 [info] shell: bash
2025-02-27 19:53:13.328 [info] > ~/.pyenv/versions/mcempirics/bin/python ~/.vscode/extensions/ms-python.python-2025.1.2025022501-darwin-arm64/python_files/printEnvVariables.py
2025-02-27 19:53:13.328 [info] shell: bash
...
2025-02-27 19:53:14.182 [info] Starting Pylance language server.
...
@bruecksen bruecksen changed the title Pylance Not Starting in Specific Projects Pylance not starting in specific projects Feb 27, 2025
@rchiodo
Copy link

rchiodo commented Feb 27, 2025

We don't actually start the server ourselves. The core python extension is responsible for that. Transferring.

@rchiodo rchiodo transferred this issue from microsoft/pylance-release Feb 27, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 27, 2025
@karthiknadig
Copy link
Member

@bruecksen Try adding this to your user settings and reload. See if that addresses the issue.

 "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"]

@karthiknadig karthiknadig self-assigned this Mar 4, 2025
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 4, 2025
@bruecksen
Copy link
Author

@karthiknadig no this doesn't change anything. Can I provide any more information about this issue?

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Mar 5, 2025
@tracerbiubiubiu
Copy link

got same problem, pylance seems not start.
below is python output,there is no python language server output at all

2025-03-05 09:43:59.347 [info] Experiment 'pythonSurveyNotification' is active
2025-03-05 09:43:59.347 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-03-05 09:43:59.347 [info] Experiment 'pythonTestAdapter' is active
2025-03-05 09:43:59.347 [info] Native locator: Refresh started
2025-03-05 09:43:59.347 [info] Native locator: Refresh finished in 172 ms
2025-03-05 09:43:59.360 [info] Python interpreter path: /usr/bin/python3
2025-03-05 09:44:00.917 [info] > pyenv which python
2025-03-05 09:44:00.918 [info] cwd: .

here is my environment:
python3.10.12
Linux xxxx 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
VSCode version 1.97.2
extensions:
pylance:2025.2.1
python:2025.0.0,
using remote SSH

@karthiknadig
Copy link
Member

@bruecksen Can you share the logs from Output > Python? I recommend setting the log level to Trace via Developer: set log level command from the command palette. Another thing you can do is run Python: Clear cache and reload

@tracerbiubiubiu Try adding the setting I mentioned in: #24852 (comment) and also try running Python: Clear cache and reload

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 5, 2025
@tracerbiubiubiu
Copy link

hi,i have tried these ways below:

  1. uninstall python/pylance extensions and reload window
  2. add user settings as here:
    "python.analysis.logLevel": "Trace",
    "python.locator": "js",
    "python.experiments.optOutFrom": [
        "pythonTerminalEnvVarActivation"
    ],

and run Python: Clear cache and reload
and here is the result:

2025-03-06 01:47:43.294 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2025-03-06 01:47:43.294 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-03-06 01:47:43.294 [info] Experiment 'pythonSurveyNotification' is active
2025-03-06 01:47:43.294 [info] Experiment 'pythonTestAdapter' is active
2025-03-06 01:47:43.315 [warning] Dir "/home/liuxiangrui/code/python/practice/.pixi/envs" is not watchable (directory does not exist)
2025-03-06 01:47:43.422 [info] Starting Environment refresh
2025-03-06 01:47:43.422 [info] Searching for interpreters in posix paths locator
2025-03-06 01:47:43.427 [info] Searching for pyenv environments
2025-03-06 01:47:43.427 [info] Searching for conda environments
2025-03-06 01:47:43.427 [info] Searching for global virtual environments
2025-03-06 01:47:43.428 [info] Searching for custom virtual environments
2025-03-06 01:47:43.484 [info] pyenv is not installed
2025-03-06 01:47:43.484 [info] Finished searching for pyenv environments: 62 milliseconds
2025-03-06 01:47:43.484 [info] Finished searching for custom virtual envs: 60 milliseconds
2025-03-06 01:47:43.489 [info] > conda info --json
2025-03-06 01:47:43.493 [info] > hatch env show --json
2025-03-06 01:47:43.493 [info] cwd: .
2025-03-06 01:47:43.495 [info] > pyenv which python
2025-03-06 01:47:43.495 [info] cwd: .
2025-03-06 01:47:43.502 [info] > pyenv which python
2025-03-06 01:47:43.502 [info] cwd: .
2025-03-06 01:47:43.502 [info] Finished searching for global virtual envs: 79 milliseconds
2025-03-06 01:47:43.506 [info] Found: /bin/python3 --> /bin/python3.10
2025-03-06 01:47:43.506 [info] Found: /bin/python3.10 --> /bin/python3.10
2025-03-06 01:47:43.512 [info] Found: /usr/bin/python3 --> /usr/bin/python3.10
2025-03-06 01:47:43.512 [info] Found: /usr/bin/python3.10 --> /usr/bin/python3.10
2025-03-06 01:47:43.525 [info] Finished searching for interpreters in posix paths locator: 103 milliseconds
2025-03-06 01:47:43.525 [info] > /bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/interpreterInfo.py
2025-03-06 01:47:43.530 [info] > /usr/bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/interpreterInfo.py
2025-03-06 01:47:43.530 [info] Environments refresh paths discovered (event): 111 milliseconds
2025-03-06 01:47:43.530 [info] Environments refresh paths discovered: 111 milliseconds
2025-03-06 01:47:44.779 [info] Environments refresh finished (event): 1360 milliseconds
2025-03-06 01:47:44.792 [info] Environment refresh took 1373 milliseconds
2025-03-06 01:47:44.855 [info] Python interpreter path: /bin/python3

it seems there is no output in python language server
4. i tried reinstall VSCode and do all tries above again,nothing changes
5. i created a new project locally with all suggested configuration mentioned ,and even there is no python language server options in output. Only Python and Python Test Log, with python extension loading all the time

2025-03-06 09:59:04.401 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2025-03-06 09:59:04.401 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-03-06 09:59:04.401 [info] Experiment 'pythonSurveyNotification' is active
2025-03-06 09:59:04.402 [info] Experiment 'pythonTestAdapter' is active
2025-03-06 09:59:04.402 [info] Native locator: Refresh started
2025-03-06 09:59:04.402 [info] Native locator: Refresh started
2025-03-06 09:59:04.402 [info] Native locator: Refresh started
2025-03-06 09:59:04.402 [info] > pyenv which python
2025-03-06 09:59:04.402 [info] cwd: .
  1. i tried using venv interpreter,and here is output > python
2025-03-06 02:07:33.432 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2025-03-06 02:07:33.432 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-03-06 02:07:33.432 [info] Experiment 'pythonSurveyNotification' is active
2025-03-06 02:07:33.432 [info] Experiment 'pythonTestAdapter' is active
2025-03-06 02:07:33.454 [warning] Dir "/home/liuxiangrui/code/python/practice/.pixi/envs" is not watchable (directory does not exist)
2025-03-06 02:07:33.724 [info] Starting Environment refresh
2025-03-06 02:07:33.724 [info] Searching for interpreters in posix paths locator
2025-03-06 02:07:33.730 [info] Searching for pyenv environments
2025-03-06 02:07:33.730 [info] Searching for conda environments
2025-03-06 02:07:33.730 [info] Searching for global virtual environments
2025-03-06 02:07:33.730 [info] Searching for custom virtual environments
2025-03-06 02:07:33.782 [info] pyenv is not installed
2025-03-06 02:07:33.782 [info] Finished searching for pyenv environments: 57 milliseconds
2025-03-06 02:07:33.782 [info] Finished searching for custom virtual envs: 56 milliseconds
2025-03-06 02:07:33.786 [info] > conda info --json
2025-03-06 02:07:33.790 [info] > hatch env show --json
2025-03-06 02:07:33.790 [info] cwd: .
2025-03-06 02:07:33.794 [info] > pyenv which python
2025-03-06 02:07:33.794 [info] cwd: .
2025-03-06 02:07:33.799 [info] > pyenv which python
2025-03-06 02:07:33.799 [info] cwd: .
2025-03-06 02:07:33.799 [info] Finished searching for global virtual envs: 73 milliseconds
2025-03-06 02:07:33.804 [info] Found: /bin/python3 --> /bin/python3.10
2025-03-06 02:07:33.804 [info] Found: /bin/python3.10 --> /bin/python3.10
2025-03-06 02:07:33.816 [info] Found: /usr/bin/python3 --> /usr/bin/python3.10
2025-03-06 02:07:33.816 [info] Found: /usr/bin/python3.10 --> /usr/bin/python3.10
2025-03-06 02:07:33.823 [info] > ./.venv/bin/python -I ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/interpreterInfo.py
2025-03-06 02:07:33.837 [info] Finished searching for interpreters in posix paths locator: 113 milliseconds
2025-03-06 02:07:33.837 [info] > /bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/interpreterInfo.py
2025-03-06 02:07:33.840 [info] Environments refresh paths discovered (event): 119 milliseconds
2025-03-06 02:07:33.840 [info] Environments refresh paths discovered: 119 milliseconds
2025-03-06 02:07:33.851 [info] > /usr/bin/python3 -I ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/interpreterInfo.py
2025-03-06 02:07:33.876 [info] Environments refresh finished (event): 155 milliseconds
2025-03-06 02:07:33.893 [info] Environment refresh took 169 milliseconds
2025-03-06 02:07:35.210 [info] Python interpreter path: ./.venv/bin/python

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Mar 6, 2025
@bruecksen
Copy link
Author

@karthiknadig I tried clear cache and setting the log level. Here is the Python output log. Now with the log level set to trace i see the pyenv error. I don't use pyenv. Is this something i can configure/disable?

python output log
2025-03-07 08:12:16.377 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2025-03-07 08:12:16.377 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-03-07 08:12:16.377 [info] Experiment 'pythonTestAdapter' is active
2025-03-07 08:12:16.377 [info] Native locator: Refresh started
2025-03-07 08:12:16.377 [info] Native locator: Refresh started
2025-03-07 08:12:16.377 [info] > pyenv which python
2025-03-07 08:12:16.377 [info] cwd: .
2025-03-07 08:12:16.377 [info] Discover tests for workspace name: ut - uri: /Users/bruecksen/Sites/ut/unbound_trajectories/core/wagtail_hooks.py
2025-03-07 08:12:16.533 [info] Poetry environment manager found at: /Users/bruecksen/Library/Application Support/pypoetry/venv/bin/poetry
2025-03-07 08:12:16.612 [info] Python interpreter path: ~/.virtualenvs/ut/bin/python
2025-03-07 08:12:47.727 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2025-03-07 08:12:47.727 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-03-07 08:12:47.727 [info] Experiment 'pythonTestAdapter' is active
2025-03-07 08:12:47.727 [info] Native locator: Refresh started
2025-03-07 08:12:47.727 [debug] Testing: Setting up watcher for /Users/bruecksen/Sites/ut
2025-03-07 08:12:47.727 [info] Native locator: Refresh started
2025-03-07 08:12:47.730 [debug] Received shell integration sequence for bash
2025-03-07 08:12:47.738 [debug] Dump environment variables {
    "PYTHONPATH": ":",
    "DJANGO_SETTINGS": "unbound_trajectories/config/settings.py",
    "BASH_SILENCE_DEPRECATION_WARNING": "1",
    "COMMAND_MODE": "unix2003",
    "DJANGO_READ_DOT_ENV_FILE": "True",
    "HOME": "/Users/bruecksen",
    "LOGNAME": "bruecksen",
    "MallocNanoZone": "0",
    "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined",
    "PWD": "/",
    "SHELL": "/bin/bash",
    "SHLVL": "1",
    "SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.pqIIwPCmCO/Listeners",
    "TMPDIR": "/var/folders/bj/hf5sdv3s7lzf1wcq95vw82cc0000gn/T/",
    "USER": "bruecksen",
    "VIRTUALENVWRAPPER_HOOK_DIR": "/Users/bruecksen/.virtualenvs",
    "VIRTUALENVWRAPPER_PROJECT_FILENAME": ".project",
    "VIRTUALENVWRAPPER_PYTHON": "/usr/local/bin/python3",
    "VIRTUALENVWRAPPER_SCRIPT": "/Library/Frameworks/Python.framework/Versions/3.11/bin/virtualenvwrapper.sh",
    "VIRTUALENVWRAPPER_VIRTUALENV": "/Library/Frameworks/Python.framework/Versions/3.11/bin/virtualenv",
    "VIRTUALENVWRAPPER_WORKON_CD": "1",
    "VSCODE_CODE_CACHE_PATH": "/Users/bruecksen/Library/Application Support/Code/CachedData/e54c774e0add60467559eb0d1e229c6452cf8447",
    "VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
    "VSCODE_CWD": "/",
    "VSCODE_ESM_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
    "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
    "VSCODE_IPC_HOOK": "/Users/bruecksen/Library/Application Support/Code/1.97-main.sock",
    "VSCODE_NLS_CONFIG": "{\"userLocale\":\"en\",\"osLocale\":\"de-de\",\"resolvedLanguage\":\"en\",\"defaultMessagesFile\":\"/Applications/Visual Studio Code.app/Contents/Resources/app/out/nls.messages.json\",\"locale\":\"en\",\"availableLanguages\":{}}",
    "VSCODE_PID": "9968",
    "WORKON_HOME": "/Users/bruecksen/.virtualenvs",
    "XPC_FLAGS": "0x0",
    "XPC_SERVICE_NAME": "application.com.microsoft.VSCode.168532012.168532018",
    "_": "/Applications/Visual Studio Code.app/Contents/MacOS/Electron",
    "__CFBundleIdentifier": "com.microsoft.VSCode",
    "__CF_USER_TEXT_ENCODING": "0x1F5:0x0:0x3",
    "ELECTRON_RUN_AS_NODE": "1",
    "VSCODE_L10N_BUNDLE_LOCATION": "",
    "PATH": "/Library/Frameworks/Python.framework/Versions/3.11/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/bruecksen/.local/bin:/usr/local/mysql/bin:/opt/homebrew/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local/Cellar/mysql/8.0.12/bin/:usr/local/share/python:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/sbin"
}
2025-03-07 08:12:47.739 [info] > pyenv which python
2025-03-07 08:12:47.739 [info] cwd: .
2025-03-07 08:12:47.750 [debug] [Error: Command failed: pyenv which python
/bin/sh: pyenv: command not found

	at genericNodeError (node:internal/errors:984:15)
	at wrappedFn (node:internal/errors:538:14)
	at ChildProcess.exithandler (node:child_process:423:12)
	at ChildProcess.emit (node:events:530:35)
	at maybeClose (node:internal/child_process:1104:16)
	at Socket.<anonymous> (node:internal/child_process:456:11)
	at Socket.emit (node:events:518:28)
	at Pipe.<anonymous> (node:net:343:12)] {
  code: 127,
  killed: false,
  signal: null,
  cmd: 'pyenv which python'
}
2025-03-07 08:12:47.754 [debug] Python API env change detected /usr/local/bin/python3 add
2025-03-07 08:12:47.759 [debug] Python API env change detected /usr/local/bin/python3.10 add
2025-03-07 08:12:47.761 [info] Poetry environment manager found at: /Users/bruecksen/Library/Application Support/pypoetry/venv/bin/poetry
2025-03-07 08:12:47.763 [debug] Python API env change detected /Users/bruecksen/.pyenv/versions/mcempirics/bin/python add
2025-03-07 08:12:47.764 [debug] Python API env change detected /Users/bruecksen/.pyenv/versions/3.7.12/bin/python add
2025-03-07 08:12:47.765 [debug] Python API env change detected /usr/local/bin/python3.7 add
2025-03-07 08:12:47.765 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/brueckio/bin/python add
2025-03-07 08:12:47.766 [debug] Python API env change detected /usr/local/bin/python3.8 add
2025-03-07 08:12:47.766 [debug] Python API env change detected /Users/bruecksen/Library/Caches/pypoetry/virtualenvs/unbound-trajectories-wagtail-hQSuZdI_-py3.13/bin/python add
2025-03-07 08:12:47.767 [debug] Python API env change detected /Users/bruecksen/Library/Caches/pypoetry/virtualenvs/unbound-trajectories-wagtail-hQSuZdI_-py3.12/bin/python add
2025-03-07 08:12:47.768 [debug] Python API env change detected /usr/bin/python3 add
2025-03-07 08:12:47.770 [debug] Python API env change detected /usr/local/bin/python3.5 add
2025-03-07 08:12:47.777 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cireg/bin/python add
2025-03-07 08:12:47.790 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/hfbk/bin/python add
2025-03-07 08:12:47.799 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/hfbk2/bin/python add
2025-03-07 08:12:47.799 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/odoo16/bin/python add
2025-03-07 08:12:47.800 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/hfbk39/bin/python add
2025-03-07 08:12:47.800 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/lifelessons/bin/python add
2025-03-07 08:12:47.800 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/meta/bin/python add
2025-03-07 08:12:47.801 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/python=python3.10/bin/python add
2025-03-07 08:12:47.802 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/lifelessons-llm/bin/python add
2025-03-07 08:12:47.802 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/unbound-trajectories-wagtail-hQSuZdI_-py3.13/bin/python add
2025-03-07 08:12:47.803 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/twotrickpony/bin/python add
2025-03-07 08:12:47.804 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/hfbk311/bin/python add
2025-03-07 08:12:47.804 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/isimip2/bin/python add
2025-03-07 08:12:47.804 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/kaluza/bin/python add
2025-03-07 08:12:47.805 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/kfo/bin/python add
2025-03-07 08:12:47.805 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/kaluza2/bin/python add
2025-03-07 08:12:47.805 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/karikatur/bin/python add
2025-03-07 08:12:47.805 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/workshopev/bin/python add
2025-03-07 08:12:47.806 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/wagtail-newsletter/bin/python add
2025-03-07 08:12:47.806 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/test/bin/python add
2025-03-07 08:12:47.809 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/bakeup/bin/python add
2025-03-07 08:12:47.809 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/caspering/bin/python add
2025-03-07 08:12:47.810 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/pumpwerk/bin/python add
2025-03-07 08:12:47.810 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/mcempirics310/bin/python add
2025-03-07 08:12:47.810 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/ut/bin/python add
2025-03-07 08:12:47.812 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/ut/bin/python update
2025-03-07 08:12:47.812 [info] Python interpreter path: ~/.virtualenvs/ut/bin/python
2025-03-07 08:12:47.815 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/wagtail/bin/python add
2025-03-07 08:12:47.816 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/hfbk-master/bin/python add
2025-03-07 08:12:47.816 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/bakerydemo/bin/python add
2025-03-07 08:12:47.817 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/lifelessons-prod/bin/python add
2025-03-07 08:12:47.817 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/lifelessons-clean/bin/python add
2025-03-07 08:12:47.819 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/isimip311/bin/python add
2025-03-07 08:12:47.819 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/python310/bin/python add
2025-03-07 08:12:47.822 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/django-oscar/bin/python add
2025-03-07 08:12:47.823 [debug] Python API env change detected /opt/homebrew/bin/python3.9 add
2025-03-07 08:12:47.823 [debug] Python API env change detected /opt/homebrew/bin/python3.12 add
2025-03-07 08:12:47.824 [debug] Python API env change detected /opt/homebrew/bin/python3.11 add
2025-03-07 08:12:48.430 [debug] Python API env change detected /opt/homebrew/bin/python3 add
2025-03-07 08:12:48.467 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/safetyio/bin/python add
2025-03-07 08:12:48.467 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/safetyio/bin/python3 add
2025-03-07 08:12:48.468 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/safetyio/bin/python3.8 add
2025-03-07 08:12:48.471 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/django-oscar/bin/python3 add
2025-03-07 08:12:48.471 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/django-oscar/bin/python3.8 add
2025-03-07 08:12:48.500 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cruising/bin/python add
2025-03-07 08:12:48.500 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/etfapp/bin/python add
2025-03-07 08:12:48.501 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/etfapp/bin/python3 add
2025-03-07 08:12:48.501 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/etf/bin/python add
2025-03-07 08:12:48.502 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/etf/bin/python3 add
2025-03-07 08:12:48.502 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/etf/bin/python3.5 add
2025-03-07 08:12:48.502 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/distylerie/bin/python add
2025-03-07 08:12:48.503 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/distylerie/bin/python3 add
2025-03-07 08:12:48.503 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/notifhain/bin/python add
2025-03-07 08:12:48.504 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/tenant/bin/python add
2025-03-07 08:12:48.504 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cireg-gIjHbx-z/bin/python add
2025-03-07 08:12:48.505 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/iw/bin/python add
2025-03-07 08:12:48.505 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cruising/bin/python3 add
2025-03-07 08:12:48.505 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cruising/bin/python3.5 add
2025-03-07 08:12:48.506 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/etfapp/bin/python3.5 add
2025-03-07 08:12:48.506 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/fhp-shop/bin/python add
2025-03-07 08:12:49.181 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/fhp-shop/bin/python3.5 add
2025-03-07 08:12:49.205 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/fhp-shop/bin/python3 add
2025-03-07 08:12:49.242 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/distylerie/bin/python3.5 add
2025-03-07 08:12:49.285 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/notifhain/bin/python3.5 add
2025-03-07 08:12:49.301 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/notifhain/bin/python3 add
2025-03-07 08:12:49.302 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/ra-scrape/bin/python add
2025-03-07 08:12:49.302 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/tenant/bin/python3 add
2025-03-07 08:12:49.302 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/ra-scrape/bin/python3 add
2025-03-07 08:12:49.302 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/ra-scrape/bin/python3.5 add
2025-03-07 08:12:49.305 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/vgh/bin/python add
2025-03-07 08:12:49.309 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cireg-gIjHbx-z/bin/python3 add
2025-03-07 08:12:49.314 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/iw/bin/python3 add
2025-03-07 08:12:49.335 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/iw/bin/python3.5 add
2025-03-07 08:12:49.371 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/tenant/bin/python3.5 add
2025-03-07 08:12:49.380 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/vgh/bin/python3 add
2025-03-07 08:12:49.400 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/vgh/bin/python3.5 add
2025-03-07 08:12:49.404 [debug] Python API env change detected /Users/bruecksen/.virtualenvs/cireg-gIjHbx-z/bin/python3.5 add

@karthiknadig
Copy link
Member

@bruecksen the pyenv error should not affect the launch of pylance. Can you try this Help > Toggle Developer tools, then see if there are any errors reported there.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 7, 2025
@bschnurr
Copy link
Member

bschnurr commented Mar 7, 2025

switching to an older pylance version and then back fixed a similar issue i had on mac

@tracerbiubiubiu
Copy link

tracerbiubiubiu commented Mar 11, 2025

update,when i tried using venv,there was some output > python language server

2025-03-11 08:56:16.538 [info] [Info  - 8:56:16 AM] (4728) Server root directory: file:///e%3A/users/LiuXR11/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-11 08:56:16.540 [info] [Info  - 8:56:16 AM] (4728) Pylance language server 2025.3.1 (pyright version 1.1.396, commit 3e2236a7) starting
2025-03-11 08:56:16.546 [info] [Error - 8:56:16 AM] Server initialization failed.
2025-03-11 08:56:16.546 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:16.547 [info] [Error - 8:56:16 AM] Pylance client: couldn't create connection to server.
2025-03-11 08:56:16.547 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:19.786 [info] [Error - 8:56:19 AM] Server process exited with code 1.
2025-03-11 08:56:19.787 [info] [Info  - 8:56:19 AM] Connection to server got closed. Server will restart.
2025-03-11 08:56:19.787 [info] true
2025-03-11 08:56:20.618 [info] [Info  - 8:56:20 AM] (49792) Server root directory: file:///e%3A/users/LiuXR11/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-11 08:56:20.620 [info] [Info  - 8:56:20 AM] (49792) Pylance language server 2025.3.1 (pyright version 1.1.396, commit 3e2236a7) starting
2025-03-11 08:56:20.625 [info] [Error - 8:56:20 AM] Server initialization failed.
2025-03-11 08:56:20.625 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:20.625 [info] [Error - 8:56:20 AM] Pylance client: couldn't create connection to server.
2025-03-11 08:56:20.625 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:20.625 [info] [Error - 8:56:20 AM] Restarting server failed
2025-03-11 08:56:20.626 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:23.211 [info] [Error - 8:56:23 AM] Server process exited with code 1.
2025-03-11 08:56:23.212 [info] [Info  - 8:56:23 AM] Connection to server got closed. Server will restart.
2025-03-11 08:56:23.212 [info] true
2025-03-11 08:56:24.038 [info] [Info  - 8:56:24 AM] (32788) Server root directory: file:///e%3A/users/LiuXR11/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-11 08:56:24.041 [info] [Info  - 8:56:24 AM] (32788) Pylance language server 2025.3.1 (pyright version 1.1.396, commit 3e2236a7) starting
2025-03-11 08:56:24.046 [info] [Error - 8:56:24 AM] Server initialization failed.
2025-03-11 08:56:24.046 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:24.047 [info] [Error - 8:56:24 AM] Pylance client: couldn't create connection to server.
2025-03-11 08:56:24.047 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:24.047 [info] [Error - 8:56:24 AM] Restarting server failed
2025-03-11 08:56:24.047 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:26.767 [info] [Error - 8:56:26 AM] Server process exited with code 1.
2025-03-11 08:56:26.768 [info] [Info  - 8:56:26 AM] Connection to server got closed. Server will restart.
2025-03-11 08:56:26.768 [info] true
2025-03-11 08:56:27.503 [info] [Info  - 8:56:27 AM] (54888) Server root directory: file:///e%3A/users/LiuXR11/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-11 08:56:27.506 [info] [Info  - 8:56:27 AM] (54888) Pylance language server 2025.3.1 (pyright version 1.1.396, commit 3e2236a7) starting
2025-03-11 08:56:27.512 [info] [Error - 8:56:27 AM] Server initialization failed.
2025-03-11 08:56:27.512 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:27.512 [info] [Error - 8:56:27 AM] Pylance client: couldn't create connection to server.
2025-03-11 08:56:27.512 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:27.512 [info] [Error - 8:56:27 AM] Restarting server failed
2025-03-11 08:56:27.512 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:29.851 [info] [Error - 8:56:29 AM] Server process exited with code 1.
2025-03-11 08:56:29.852 [info] [Info  - 8:56:29 AM] Connection to server got closed. Server will restart.
2025-03-11 08:56:29.852 [info] true
2025-03-11 08:56:30.606 [info] [Info  - 8:56:30 AM] (52472) Server root directory: file:///e%3A/users/LiuXR11/.vscode/extensions/ms-python.vscode-pylance-2025.3.1/dist
2025-03-11 08:56:30.608 [info] [Info  - 8:56:30 AM] (52472) Pylance language server 2025.3.1 (pyright version 1.1.396, commit 3e2236a7) starting
2025-03-11 08:56:30.614 [info] [Error - 8:56:30 AM] Server initialization failed.
2025-03-11 08:56:30.614 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:30.614 [info] [Error - 8:56:30 AM] Pylance client: couldn't create connection to server.
2025-03-11 08:56:30.614 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:30.614 [info] [Error - 8:56:30 AM] Restarting server failed
2025-03-11 08:56:30.615 [info]   Message: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


  Code: -32603 
2025-03-11 08:56:32.944 [info] [Error - 8:56:32 AM] Server process exited with code 1.
2025-03-11 08:56:32.944 [info] [Error - 8:56:32 AM] The Pylance server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

this happens when i uninstalled python extension and reinstall it,and output > python shows below:

2025-03-11 08:56:13.791 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2025-03-11 08:56:13.791 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-03-11 08:56:13.791 [info] Experiment 'pythonSurveyNotification' is active
2025-03-11 08:56:13.791 [info] Experiment 'pythonTestAdapter' is active
2025-03-11 08:56:13.791 [info] Native locator: Refresh started
2025-03-11 08:56:13.791 [info] Native locator: Refresh started
2025-03-11 08:56:13.791 [info] > pyenv which python
2025-03-11 08:56:13.791 [info] cwd: .
2025-03-11 08:56:14.759 [info] Native locator: Refresh finished in 1427 ms
2025-03-11 08:56:15.391 [info] Python interpreter path: .\.venv\Scripts\python.exe
2025-03-11 08:56:16.554 [error] [
  `Failed to start language server, Class name = h, completed in 1161ms, has a falsy return value, Arg 1: <Uri:e:\\users\\LiuXR11\\go\\src\\python_practice>, Arg 2: {"id":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv\\\\Scripts\\\\python.exe","sysPrefix":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv","envType":"Venv","envName":".venv","envPath":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv\\\\Scripts\\\\python.exe","path":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv\\\\Scripts\\\\python.exe","architecture":3,"sysVersion":"","version":{"raw":"3.11.2","major":3,"minor":11,"patch":2,"build":[],"prerelease":[]},"displayName":"Python 3.11.2 ('.venv')","detailedDisplayName":"Python 3.11.2 ('.venv')","type":"Virtual"}, Arg 3: {"documentSelector":[{"scheme":"file","language":"python"},{"scheme":"untitled","language":"python"},{"scheme":"vscode-notebook","language":"python"},{"scheme":"vscode-notebook-cell","language":"python"},{"scheme":"vscode-interactive-input","language":"python"}],"synchronize":{"configurationSection":["python","jupyter.runStartupCommands"]},"outputChannel":{"name":"Python Language Server","logLevel":3},"revealOutputChannelOn":4,"initializationOptions":{"experimentationSupport":true,"trustedWorkspaceSupport":true},"middleware":{"serviceContainer":{"container":{"options":{"autoBindInjectable":false,"defaultScope":"Transient","skipBaseClassChecks":true},"id":0,"_bindingDictionary":{"_map":{}},"_snapshots":[],"_middleware":null,"_activations":{"_map":{}},"_deactivations":{"_map":{}},"parent":null,"_metadataReader":{},"_moduleActivationStore":{"_map":{}}}},"serverVersion":"2025.3.1","lastCaptured":{},"nextWindow":0,"eventCount":0,"workspace":{},"connectedPromise":{"scope":null,"_resolved":false,"_rejected":false,"_promise":{}},"notebooks":{},"eventName":"LANGUAGE_SERVER.REQUEST"},"connectionOptions":{"cancellationStrategy":{"_sender":{"folderName":"981cf54117a90c89c18f8f744a789f6f32f5f85194"}}}}, Return Value: undefined`,
  [l [Error]: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.
  
  
  	at ae (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1974693)
  	at oe (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1972653)
  	at Immediate.<anonymous> (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1968947)
  	at process.processImmediate (node:internal/timers:483:21)] {
    code: -32603,
    data: undefined
  }
]
2025-03-11 08:56:16.554 [error] [
  'Starting language server, Class name = p, completed in 1164ms, has a falsy return value, , Return Value: undefined',
  [l [Error]: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.
  
  
  	at ae (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1974693)
  	at oe (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1972653)
  	at Immediate.<anonymous> (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1968947)
  	at process.processImmediate (node:internal/timers:483:21)] {
    code: -32603,
    data: undefined
  }
]
2025-03-11 08:56:16.555 [error] [
  `Failed to start language server, Class name = p, completed in 1166ms, has a falsy return value, Arg 1: <Uri:e:\\users\\LiuXR11\\go\\src\\python_practice>, Arg 2: {"id":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv\\\\Scripts\\\\python.exe","sysPrefix":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv","envType":"Venv","envName":".venv","envPath":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv\\\\Scripts\\\\python.exe","path":"E:\\\\users\\\\LiuXR11\\\\go\\\\src\\\\python_practice\\\\.venv\\\\Scripts\\\\python.exe","architecture":3,"sysVersion":"","version":{"raw":"3.11.2","major":3,"minor":11,"patch":2,"build":[],"prerelease":[]},"displayName":"Python 3.11.2 ('.venv')","detailedDisplayName":"Python 3.11.2 ('.venv')","type":"Virtual"}, Return Value: undefined`,
  [l [Error]: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.
  
  
  	at ae (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1974693)
  	at oe (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1972653)
  	at Immediate.<anonymous> (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1968947)
  	at process.processImmediate (node:internal/timers:483:21)] {
    code: -32603,
    data: undefined
  }
]
2025-03-11 08:56:16.555 [error] [
  'Failed to activate a workspace, Class name = v, completed in 3051ms, has a falsy return value, Arg 1: <Uri:e:\\users\\LiuXR11\\go\\src\\python_practice>, Arg 2: {"started":1741654573117}, Return Value: undefined',
  [l [Error]: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.
  
  
  	at ae (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1974693)
  	at oe (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1972653)
  	at Immediate.<anonymous> (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1968947)
  	at process.processImmediate (node:internal/timers:483:21)] {
    code: -32603,
    data: undefined
  }
]
2025-03-11 08:56:16.555 [error] Failure during activation. [l [Error]: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


	at ae (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1974693)
	at oe (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1972653)
	at Immediate.<anonymous> (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1968947)
	at process.processImmediate (node:internal/timers:483:21)] {
  code: -32603,
  data: undefined
}
2025-03-11 08:56:16.556 [error] sendStartupTelemetry() failed. [l [Error]: Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any way that is against the law or to create or propagate malware; or share, publish, distribute, or lease the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone offering for others to use, or transfer the software or this agreement to any third party.


	at ae (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1974693)
	at oe (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1972653)
	at Immediate.<anonymous> (e:\users\LiuXR11\.vscode\extensions\ms-python.python-2025.2.0-win32-x64\out\client\extension.js:2:1968947)
	at process.processImmediate (node:internal/timers:483:21)] {
  code: -32603,
  data: undefined
}

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Mar 11, 2025
@karthiknadig
Copy link
Member

Can you share the VS Code about? like this:

Image

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 11, 2025
@tracerbiubiubiu
Copy link

Image

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Mar 11, 2025
@tracerbiubiubiu
Copy link

tracerbiubiubiu commented Mar 11, 2025

update,i delete all related to vscode,including config files and extensions ,all of them ,and reinstall it. Then pylance just works fine.Is there any further info i can provide ?
there is one thing i found
when i install Extension Pack for Java, the problem seems happened again, python extensions loading all the time, and uninstall packages in it and restart extensions , pylance works fine. Maybe try restart extensions will help.

@bruecksen
Copy link
Author

@tracerbiubiubiu what exactly did you do to delete everything? Now all my projects are effected and pylance is not starting... My About screen:

Version: 1.98.1 (Universal)
Commit: 2fc07b811f760549dab9be9d2bedd06c51dfcb9a
Date: 2025-03-10T15:38:08.854Z
Electron: 34.2.0
ElectronBuildId: 11160463
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Darwin arm64 23.5.0

@bruecksen
Copy link
Author

@tracerbiubiubiu i did now the same, removed everything and now it is working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

6 participants