-
Notifications
You must be signed in to change notification settings - Fork 770
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, Pylance: report issue...` doesn't work #7011
Comments
For posterity, I looked at the Python extension outputs, and found out that the extension picked up some really old, no longer functional python installation in my environment.
Removing the bad python installation allowed the extension pick up an actually valid python to start the language server. I have never had to look at extension outputs until this, and so it didn't occur to me that they actually existed in the output tabs. IMO, that was a clear error message that should have been surfaced to the user. |
@hrl20 I have the same issue only with a new project. In my old projects the language server is working. I also tried to setup a clean project. It has the same issue. Python interpreter is selected but pylance is not starting. Anyone any idea what i can do to make this work? |
@bruecksen have you checked the Python extension output in the output tab? |
@hrl20 i don't have Python output (pylance not working)2025-02-27 08:21:12.451 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-02-27 08:21:12.451 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-02-27 08:21:12.451 [info] Experiment 'pythonTestAdapter' is active
2025-02-27 08:21:12.451 [info] Native locator: Refresh started
2025-02-27 08:21:12.451 [info] Native locator: Refresh started
2025-02-27 08:21:12.508 [info] Python interpreter path: ~/.virtualenvs/ut/bin/python Python output (pylance working)2025-02-27 08:21:12.897 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-02-27 08:21:12.897 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-02-27 08:21:12.897 [info] Experiment 'pythonTestAdapter' is active
2025-02-27 08:21:12.897 [info] Native locator: Refresh started
2025-02-27 08:21:12.908 [info] > pyenv which python
2025-02-27 08:21:12.908 [info] cwd: .
2025-02-27 08:21:14.527 [info] Python interpreter path: ~/.virtualenvs/lifelessons/bin/python
2025-02-27 08:21:14.885 [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 08:21:14.885 [info] shell: bash
2025-02-27 08:21:14.924 [info] > /usr/local/bin/python3 ~/.vscode/extensions/ms-python.python-2025.1.2025022501-darwin-arm64/python_files/printEnvVariables.py
2025-02-27 08:21:14.924 [info] shell: bash
... |
this is slightly different from my issue i think. i would try removing |
@hrl20 hmm ok. it sounded more or less the same. Is your language server starting do you see this in the python output? I tried all the different python environments. New ones, existing ones. nothing helped. |
@hl20, can this issue be closed? The vscode-python team is looking at microsoft/vscode-python#24839 which seems like a duplicate of this issue to me. |
Since
Pylance: report issue...
doesn't work, i've created an issue under vscode-python throughPython: report issue...
microsoft/vscode-python#24839
Here's a copy of the report
Type: Bug
Behaviour
Pylance intellisense is completely not working (go to reference/definition even for the standard python library).
Running the
Python: Restart Language server
command results incommand 'python.analysis.restartLanguageServer' not found
After selecting an interpreter (./.venv/bin/python), opening a terminal shows
Python virtual environment was successfully activated, even though "(.venv)" indicator may not be present in the terminal prompt. Learn more.
However, if I try to callpython
it would still failzsh: command not found: python
I've tried uninstall and reinstalling the extensions at least 10 times. Including deleting the python-related folders from the
~/.vscode/extensions
folder.Now i'm trying the disable/reenable/unintsall/reinstall loop again, and this time, when i click enable in the Python extension, i get this error about Pylance:
Developer tools sometimes has some error message:
notificationsAlerts.ts:42 Sorry, something went wrong activating IntelliCode support for Python. Please check the "Python" and "VS IntelliCode" output windows for details. c @ notificationsAlerts.ts:42
Steps to reproduce:
Just install the regular Python + Python debugger + Pylance. Try selecting interpreter. Observe everything fail miserably.
Extension version: 2025.0.0
VS Code version: Code 1.97.2 (Universal) (e54c774e0add60467559eb0d1e229c6452cf8447, 2025-02-12T23:20:35.343Z)
OS version: Darwin arm64 22.6.0
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
Environment data
Code Snippet
Try to run
Pylance: report issue...
See this in devtools
The text was updated successfully, but these errors were encountered: