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 v2023.10.50 is incompatible with Python Extension v2020.8.109390 #5019

Closed
yakamoz423 opened this issue Oct 27, 2023 · 53 comments
Closed
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet

Comments

@yakamoz423
Copy link

Environment data

  • Language Server version: v2023.10.50
  • OS and version: Windows 11 Pro 22H2 22621.2428
  • Python version (& distribution if applicable, e.g. Anaconda): 3.5.4

Code Snippet

XXX

Repro Steps

Since I‘m using Python 3.5.4, I switched Python extension to v2020.8.109390 so that I can use the debugger. In previous versions everything works fine until v2023.10.50. I got Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio ..., but I actually did not do anything it listed above.

  1. Switch Python extension to v2020.8.109390
  2. Use latest Pylance
  3. Open a Python file, you can see the Python extension shows 2 error messages
  4. Switch Pylance to v2023.10.40, or use latest Python extension
  5. It works

Expected behavior

Python extension works fine

Actual behavior

image

Logs

Output from Python Language Server:

[Info  - 11:20:59 AM] (5568) Pylance language server 2023.10.50 (pyright cfe56bfb) starting
[Info  - 11:20:59 AM] (5568) Server root directory: C:\Users\Yolo\.vscode\extensions\ms-python.vscode-pylance-2023.10.50\dist
[Error - 11:20:59 AM] Server initialization failed.
  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 
[Error - 11:20:59 AM] Starting client failed
  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 
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Oct 27, 2023
@silent780
Copy link

Same issue, Have to roll back to v2023.10.40

@sys-default
Copy link

Same issue 👆

@msmhi52
Copy link

msmhi52 commented Oct 27, 2023

Just received the same message!

@cottrell
Copy link

Same. Broken.

@assombrance
Copy link

assombrance commented Oct 27, 2023

I have seemingly this problem too, on first glance, but I have a nuance to add:
changing the python interpreter fixes the problem.

Also using the latest python extension did not fix the problem.

I only tested with python interpreters already on my machine, here are the details: python 3.9.12 did not work, 3.10.4 did. It might have something to do with the various packages installed in each environment (I'm using conda to handle my vironements), but since I found a fix, I did not push the investigation forward. Hope it helped !

Note: I edited out the following text from my answer because after more testing I realized it was untrue: downgrading it to 2023.10.40 indeed worked.

the versions are not the same, and rolling back didn't solve it.

So probably not the same problem in the end, but I'm posting it here anyway, in case it helps.

Some further investigation lead me to think that something is broken about the specific python version I use. Indeed, 

@emanuelegiorgi
Copy link

Same issue for me,
I have Python extension v2022.16.1 and Python 3.9.18.

It works if I roll back to v2023.10.40, as suggested here.

@cottrell
Copy link

Not eve 10.40 works. It's all broken.

@leontev-vyacheslav
Copy link

leontev-vyacheslav commented Oct 27, 2023

I am using Python v2022.8.0 extension and Python 3.16.15 in devcontainer.
Today after updating Pylance (Pylance v2023.10.50) I have the same big error. Pylance doesn't work at all.

My devcontainer:

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Python Language Server log:

[Info - 12:49:48 PM] (1752) Pylance language server 2023.10.50 (pyright cfe56bfb) starting
[Info - 12:49:48 PM] (1752) Server root directory: /home/vscode/.vscode-server/extensions/ms-python.vscode-pylance-2023.10.50/dist
[Error - 12:49:48 PM] Server initialization failed.
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
[Error - 12:49:48 PM] Pylance client: couldn't create connection to server.
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

Python extention log:

Telemetry level is off
Experiments are disabled, only manually opted experiments are active.
LSP Notebooks experiment is disabled -- not in treatment group

/workspaces/eta-regulator-board/web-ui/web-api/.venv/bin/python ~/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/interpreterInfo.py
/workspaces/eta-regulator-board/web-api/.venv/bin/python3 ~/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/interpreterInfo.py
[ERROR 2023-9-27 12:49:47.804]: [Error: Command failed: /workspaces/eta-regulator-board/web-ui/web-api/.venv/bin/python /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/get_output_via_markers.py /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/interpreterInfo.py
/bin/sh: 1: /workspaces/eta-regulator-board/web-ui/web-api/.venv/bin/python: not found

at ChildProcess.exithandler (node:child_process:420:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at Socket.<anonymous> (node:internal/child_process:449:11)
at Socket.emit (node:events:513:28)
at Pipe.<anonymous> (node:net:322:12)] {

code: 127,
killed: false,
signal: null,
cmd: '/workspaces/eta-regulator-board/web-ui/web-api/.venv/bin/python /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/get_output_via_markers.py /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/interpreterInfo.py'
}
Python interpreter path: ./web-api/.venv/bin/python3
[ERROR 2023-9-27 12:49:48.205]: [
'Failed to start language server, Class name = h, completed in 397ms, has a falsy return value, Arg 1: Uri:/workspaces/eta-regulator-board/web-ui, Arg 2: undefined, 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"},"outputChannel":{"name":"Python Language Server"},"revealOutputChannelOn":4,"initializationOptions":{"experimentationSupport":true,"trustedWorkspaceSupport":true,"lspNotebooksSupport":false},"middleware":{"serviceContainer":{"container":{"options":{"autoBindInjectable":false,"defaultScope":"Transient","skipBaseClassChecks":true},"id":0,"_bindingDictionary":{"_map":{}},"_snapshots":[],"_middleware":null,"parent":null,"_metadataReader":{}}},"serverVersion":"2023.10.50","lastCaptured":{},"nextWindow":0,"eventCount":0,"workspace":{},"connectedPromise":{"scope":null,"_resolved":false,"_rejected":false,"_promise":{}},"eventName":"LANGUAGE_SERVER.REQUEST","lspNotebooksExperiment":{"serviceContainer":{"container":{"options":{"autoBindInjectable":false,"defaultScope":"Transient","skipBaseClassChecks":true},"id":0,"_bindingDictionary":{"_map":{}},"_snapshots":[],"_middleware":null,"parent":null,"_metadataReader":{}}},"configurationService":{"serviceContainer":{"container":{"options":{"autoBindInjectable":false,"defaultScope":"Transient","skipBaseClassChecks":true},"id":0,"_bindingDictionary":{"_map":{}},"_snapshots":[],"_middleware":null,"parent":null,"_metadataReader":{}}},"workspaceService":{}},"supportedWorkspaceTypes":{"untrustedWorkspace":true,"virtualWorkspace":true},"isJupyterInstalled":true,"isInExperiment":false},"notebookAddon":{}},"connectionOptions":{"cancellationStrategy":{"_sender":{"folderName":"de252206c29efc28f138bc63d33d16a9c465376f81"}}}}, Return Value: undefined',
[s [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 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2107873
at /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108167
at Immediate. (/home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108529)
at process.processImmediate (node:internal/timers:476:21)] {
code: -32603,
data: undefined
}
]
[ERROR 2023-9-27 12:49:48.205]: [
'Starting language server, Class name = d, completed in 398ms, has a falsy return value, , Return Value: undefined',
[s [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 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2107873
at /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108167
at Immediate. (/home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108529)
at process.processImmediate (node:internal/timers:476:21)] {
code: -32603,
data: undefined
}
]
[ERROR 2023-9-27 12:49:48.205]: [
'Failed to start language server, Class name = d, completed in 398ms, has a falsy return value, Arg 1: Uri:/workspaces/eta-regulator-board/web-ui, Arg 2: undefined, Return Value: undefined',
[s [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 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2107873
at /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108167
at Immediate. (/home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108529)
at process.processImmediate (node:internal/timers:476:21)] {
code: -32603,
data: undefined
}
]
[ERROR 2023-9-27 12:49:48.205]: [
'Failed to activate a workspace, Class name = f, completed in 572ms, has a falsy return value, Arg 1: Uri:/workspaces/eta-regulator-board/web-ui/deploy.ps1, Return Value: undefined',
[s [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 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2107873
at /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108167
at Immediate. (/home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108529)
at process.processImmediate (node:internal/timers:476:21)] {
code: -32603,
data: undefined
}
]
[ERROR 2023-9-27 12:49:48.206]: Failure during activation. [s [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 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2107873
at /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108167
at Immediate. (/home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108529)
at process.processImmediate (node:internal/timers:476:21)] {
code: -32603,
data: undefined
}
[ERROR 2023-9-27 12:49:48.206]: sendStartupTelemetry() failed. [s [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 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2107873
at /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108167
at Immediate. (/home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/out/client/extension.js:2:2108529)
at process.processImmediate (node:internal/timers:476:21)] {
code: -32603,
data: undefined
}

conda info --json
/workspaces/eta-regulator-board/web-api/.venv/bin/python ~/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/linter.py -p pylint /workspaces/eta-regulator-board/web-api/.venv/bin/pylint --disable=redefined-builtin --disable=missing-module-docstring --disable=missing-class-docstring --disable=missing-function-docstring --disable=invalid-name --disable=logging-fstring-interpolation --disable=bare-except --max-line-length=140 /workspaces/eta-regulator-board/web-api/src/models/regulator/regulator_programms_model.py
cwd: /workspaces/eta-regulator-board/web-api
##########Linting Output - pylint##########

[
{
"type": "convention",
"module": "models.regulator.regulator_programms_model",
"obj": "",
"line": 32,
"column": 0,
"endLine": null,
"endColumn": null,
"path": "src/models/regulator/regulator_programms_model.py",
"symbol": "trailing-newlines",
"message": "Trailing newlines",
"message-id": "C0305"
}
]

DAP Server launched with command: /workspaces/eta-regulator-board/web-api/.venv/bin/python3 /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0/pythonFiles/lib/python/debugpy/adapter

@leontev-vyacheslav
Copy link

Absolutely perfectly it was helped to me downgrading to Pylance 2023.10.40 version. This is very good Pylance to me

@monopodog
Copy link

Rolling Pylance language server back to 2023.10.40 solved this for me. 99% of you probably know this already, but I had to muck around Google to figure out how to roll back to previous version, so if anyone needs it, here's the quick how to:

  • Open VS Code.
  • Click the Extensions icon in the left-hand pane (or Ctrl+Shift+X).
  • Scroll to the Pylance extension.
  • Click the tiny gear icon next to the Pylance extension.
  • Choose "Install another version …" from the context menu.
  • Choose 2023.10.40 (or whatever version works for you).

@luabud
Copy link
Member

luabud commented Oct 27, 2023

Hey everyone. Unfortunately it's not feasible for us to maintain Pylance compatible with older versions of the Python extension. However, if the main reason why you're using an old version of the Python extension is support for debugging Python 2.7 or Python 3.5/3.6, there may be a better workaround so you can keep using the latest Pylance and Python extensions.

We have a new Python Debugger extension that we are shipping separately so people can keep using the latest versions of the Python extension while having support for debugging older versions of Python. Specifically, the Python Debugger extension versions 2023.1.* support debugging for Python versions 3.6 and older.

This way you can continue updating the Pylance and Python extensions and only use this one older version of the Python Debugger extension.

@Tma2333-Scale
Copy link

I have similar problem with v2023.18.0 of Python Extension as well. It does not happen right away. It just crashed randomly when I am using Jupyter notebook.

@allabur
Copy link

allabur commented Oct 28, 2023

Same here with latest extension on Python (v2023.18.0) and Pylance (v2023.10.50). Changing to previous Pylance (v2023.10.40) worked for me aswell)

Error:
2023-10-27 20:03:33.046 [info] [Error - 8:03:33 PM] Restarting server failed
2023-10-27 20:03:33.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

@OttomanZ
Copy link

Hey everyone. Unfortunately it's not feasible for us to maintain Pylance compatible with older versions of the Python extension. However, if the main reason why you're using an old version of the Python extension is support for debugging Python 2.7 or Python 3.5/3.6, there may be a better workaround so you can keep using the latest Pylance and Python extensions.

We have a new Python Debugger extension that we are shipping separately so people can keep using the latest versions of the Python extension while having support for debugging older versions of Python. Specifically, the Python Debugger extension versions 2023.1.* support debugging for Python versions 3.6 and older.

This way you can continue updating the Pylance and Python extensions and only use this one older version of the Python Debugger extension.

I am working with Python 3.10 and it's still giving me the same error rolling back to a previous version fixed it.

@csf90-uk
Copy link

Hey everyone. Unfortunately it's not feasible for us to maintain Pylance compatible with older versions of the Python extension. However, if the main reason why you're using an old version of the Python extension is support for debugging Python 2.7 or Python 3.5/3.6, there may be a better workaround so you can keep using the latest Pylance and Python extensions.

We have a new Python Debugger extension that we are shipping separately so people can keep using the latest versions of the Python extension while having support for debugging older versions of Python. Specifically, the Python Debugger extension versions 2023.1.* support debugging for Python versions 3.6 and older.

This way you can continue updating the Pylance and Python extensions and only use this one older version of the Python Debugger extension.

The issue is happening even when using the latest versions of both Pylance and Python extensions.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 30, 2023

For everybody that's reproing the issue, can you state:

  • VS Code Version?
  • Local or remote?
  • Python extension version?

Thanks. We can't seem to reproduce it in house.

Note: This error is expected if you're not actually using VS code (like VS codium or Cursor). It is NOT expected if you're using VS code through SSH/WSL/Dev Container. Those should work.

@imkSushi
Copy link

imkSushi commented Oct 30, 2023

This issue started today for me too.
VS Code 1.83.1
Remote (WSL on same machine)
Python extension version v2023.18.0

Python 3.10.13 via pyenv. Was doing other stuff, issues started after I just started using VSCode's variant of jupyter notebooks today.

@csf90-uk
Copy link

For everybody that's reproing the issue, can you state:

  • VS Code Version?
  • Local or remote?
  • Python extension version?

Thanks. We can't seem to reproduce it in house.

Note: This error is expected if you're not actually using VS code (like VS codium or Cursor). It is NOT expected if you're using VS code through SSH/WSL/Dev Container. Those should work.

MacOS Sonoma 14.0
VS Code: 1.83.1
Pylance: v2023.10.50
Python: 3.11.5

Local workspace. Virtual Python environment. Using JupyterNotebooks. Rolling back to Pylance v2023.10.40 seems to have fixed the problem. Issue happened in general use, switching between notebooks, scrolling. I haven't been actively executing code all that often.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 30, 2023

Can you try 2023.10.53? I wonder if it's related to this issue: microsoft/vscode#196740. Our best guess on the other issue is that the crashes in the Pylance server are starving the VS code extension host, preventing other things from working. It might be preventing the new message we added that verifies we're running inside of VS code.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 30, 2023

If you see this in the Python Language Server output:

Debug Failure. Unable to find notebook URI for vscode-notebook-cell:

2023.10.53 might be the fix for the problem. It fixed that error.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 30, 2023

For everybody that's reproing the issue, can you state:

  • VS Code Version?
  • Local or remote?
  • Python extension version?

Thanks. We can't seem to reproduce it in house.
Note: This error is expected if you're not actually using VS code (like VS codium or Cursor). It is NOT expected if you're using VS code through SSH/WSL/Dev Container. Those should work.

MacOS Sonoma 14.0 VS Code: 1.83.1 Pylance: v2023.10.50 Python: 3.11.5

Local workspace. Virtual Python environment. Using JupyterNotebooks. Rolling back to Pylance v2023.10.40 seems to have fixed the problem. Issue happened in general use, switching between notebooks, scrolling. I haven't been actively executing code all that often.

Sorry @csf90-uk what's your Python extension version? You listed your Python version, but the Python extension needs to be a certain version for Pylance to work too.

@cbenitez81
Copy link

Vs Code version: 1.83.1
Remote: SSH
python 3.11.3

@Tma2333-Scale
Copy link

For everybody that's reproing the issue, can you state:

  • VS Code Version?
  • Local or remote?
  • Python extension version?

Thanks. We can't seem to reproduce it in house.

Note: This error is expected if you're not actually using VS code (like VS codium or Cursor). It is NOT expected if you're using VS code through SSH/WSL/Dev Container. Those should work.

VS Code Version: 1.83.1
Remote: SSH
Python extension version: v2023.18.0

Since my problem mainly happened during use of notebook, Jupyter extension version: v2023.9.1102792234. This could purely depend on the workload at the time is mainly using notebook. The symptoms for me is basically, when typing/scrolling through the code, pylance died with the message, also brought down the Jupyter kernel as well, no way to restart the kernel. Needs to reload the window to restart.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 30, 2023

Vs Code version: 1.83.1 Remote: SSH python 3.11.3

Sorry the Python extension. It should be something like this:

image

@csf90-uk
Copy link

For everybody that's reproing the issue, can you state:

  • VS Code Version?
  • Local or remote?
  • Python extension version?

Thanks. We can't seem to reproduce it in house.
Note: This error is expected if you're not actually using VS code (like VS codium or Cursor). It is NOT expected if you're using VS code through SSH/WSL/Dev Container. Those should work.

MacOS Sonoma 14.0 VS Code: 1.83.1 Pylance: v2023.10.50 Python: 3.11.5
Local workspace. Virtual Python environment. Using JupyterNotebooks. Rolling back to Pylance v2023.10.40 seems to have fixed the problem. Issue happened in general use, switching between notebooks, scrolling. I haven't been actively executing code all that often.

Sorry @csf90-uk what's your Python extension version? You listed your Python version, but the Python extension needs to be a certain version for Pylance to work too.

Apologies. v2023.18.0

@StellaHuang95
Copy link
Contributor

@csf90-uk @Tma2333-Scale and for those who have python extension 2023.6.0 or a newer version installed, were you seeing the exact same message You may install and use any number of copies of the software only with Microsoft Visual Studio..., or did you experience a different Pylance crash?

@csf90-uk
Copy link

csf90-uk commented Nov 1, 2023 via email

@alethere
Copy link

alethere commented Nov 1, 2023

Same error here.

VS Code version: version 1.83
Remote through SSH
Python extension version: v2023.18.0

@gel-alex
Copy link

gel-alex commented Nov 1, 2023

Same here, only downgrading pylance worked.

@judej judej assigned heejaechang and unassigned StellaHuang95 Nov 1, 2023
@heejaechang
Copy link
Contributor

can we get some screenshots of extensions tab and output window when the issue is happening?

image

image

currently, we can't seem to repro and none of report here provide some actionable info for us to dig in.

those screenshots will at least let us know whether we are using right env to repro the issue.

@quillaja
Copy link

quillaja commented Nov 1, 2023

Most recent VSCode, pylance, etc. For me, it's breaking on the conda environment provided by ArcGIS Pro 3.1.3, which uses python v3.9.16. Worked "fine" (although pylance can't produce intellisense for all submodules of arcpy even on the best days) last time I used this env a few months ago. Going back a few versions of pylance fixed it for me. Mostly just wanted to provide this info as another data point, since most python devs aren't probably using this particular configuration (using a preexisting conda env from ArcGIS Pro).

Edit: screenshot
image
image

@heejaechang
Copy link
Contributor

heejaechang commented Nov 1, 2023

@quillaja I am sorry to hear that the latest pylance didn't work as expected but we will need more info to find out why that happened. providing screenshots as above (please make sure info underlined is shown in the screenshots) would help us to find out root issue!

thank you

@heejaechang
Copy link
Contributor

heejaechang commented Nov 1, 2023

can you show us not only pylance version but python extension version as well? as long as we know, the failure should only happen when pylance extension is used with very old python extension we no longer support.

that said, your screen shows different issue than this issue - Request initialize failed with message: You may install and use any number of copies of ...

you probably want to open a new issue so we can take a look rather than mixing with this issue.

thank you.

by the way, python extension version and python interpreter version you marked are 2 different versions. the Request initialize failed ... problem shouldn't be affected by the python interpreter version.

@heejaechang
Copy link
Contributor

@quillaja I think your particular issue should be fixed by the latest pylance prerelease (2023.10.53)

@liuxhit
Copy link

liuxhit commented Nov 2, 2023

feedback my timeline:

  • 2023.10.50 bad
  • (found this issue, same Code: -32603)
  • 2023.10.53 bad
  • 2023.10.40 good

@neljo8m
Copy link

neljo8m commented Nov 2, 2023

I'm having the same issue.
All version info is in the screenshot.
Screenshot 2023-11-02 at 12 33 18

@heejaechang
Copy link
Contributor

heejaechang commented Nov 2, 2023

@neljo8m thank you very much for the screenshot. is your dev environment vscode, local, mac and this happen with any python file?

asking since I tried on mac os, latest vscode, local, with python but can't repro.

@heejaechang
Copy link
Contributor

@liuxhit can you share the screenshot?

@neljo8m
Copy link

neljo8m commented Nov 2, 2023

@neljo8m thank you very much for the screenshot. is your dev environment vscode, local, mac and this happen with any python file?

Yes, I'm using VS Code 1.83.1, local on Mac OS 13.6.1.
It is not specific to any particular file. And I have not noticed any pattern when it happens.
I did notice some folks here mentioned that it was related to Jupyter.
So it is interesting, this time, it did happen just after I ran a few lines of code in Jupyter, using Py comments.
Like this:

# %%
# run some python code here
v = "test"
print( f"{v=}" )
# %%

When I pressed <Shift+Enter> to run that in Jupyter, it ran fine.
But shortly after that, I received the Pylance error.
So maybe it is related to Jupyter in some way. Or maybe Jupyter just starts the problem.
I have the Jupyter plugin v2023.10.1003070148 (Microsoft)

@heejaechang
Copy link
Contributor

heejaechang commented Nov 2, 2023

@neljo8m there is a separate jupyter related issue that is fixed in pylance 2023.10.53. without log, hard to know whether which issue you are hitting. this issue is specifically about Initialization failure issue due to using the latest pylance with python extension or jupyter extension we no longer support.

@neljo8m
Copy link

neljo8m commented Nov 2, 2023

@neljo8m there is a separate jupyter related issue that is fixed in pylance 2023.10.53. without log, hard to know whether which issue you are hitting. this issue is specifically about Initialization failure issue due to using the latest pylance with python extension or jupyter extension we no longer support.

You see the version of the Python extension I am using. So it looks like that does not apply to me.

@heejaechang
Copy link
Contributor

@neljo8m

You see the version of the Python extension I am using. So it looks like that does not apply to me.

are you referring jupyter issue or intialization failed issue?

@neljo8m
Copy link

neljo8m commented Nov 3, 2023

@neljo8m

You see the version of the Python extension I am using. So it looks like that does not apply to me.

are you referring jupyter issue or intialization failed issue?

Sorry, I was not clear.
I was referring to your comment about the "issue due to using the latest
pylance with python extension or jupyter extension we no longer support".
Since I am using the latest versions, that issue does not apply.

@PylanceBot PylanceBot added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Nov 8, 2023
@bschnurr
Copy link
Member

bschnurr commented Nov 9, 2023

This issue has been fixed in prerelease version 2023.11.12, which we've just released. You can find the changelog here: CHANGELOG.md

@bschnurr bschnurr closed this as completed Nov 9, 2023
@bilzard
Copy link

bilzard commented Nov 9, 2023

@bschnurr Thank you for announcing.

This issue has been fixed in prerelease version 2023.11.21, which we've just released.

You mean version 2023.11.12?

@debonte
Copy link
Contributor

debonte commented Nov 9, 2023

You mean version 2023.11.12?

Yes, thanks. Fixed above.

@ljnsn
Copy link

ljnsn commented Aug 17, 2024

This issue is still (again?) happening on version 2024.12.3 of the Python extension.

@debonte
Copy link
Contributor

debonte commented Aug 17, 2024

@ljnsn, questions for you:

  1. Why are you using a 9-month old version of the Python extension?
  2. What version of Pylance are you trying to use?
  3. Pylance is only supported in official builds of VS Code. Are you using one?

We don't maintain a mapping of compatible historical versions of the Pylance and Python extensions. My recommendation would be to update to the latest of both.

@ljnsn
Copy link

ljnsn commented Aug 17, 2024

@debonte thanks for the quick response!

  1. That's the version that got installed, isn't it the latest one? https://github.com/microsoft/vscode-python/releases/tag/v2024.12.3 released four days ago?
  2. Pylance is 2024.8.1
  3. It's the build provided by my package manager, so not the official one. vscode is version 1.91.1

We don't maintain a mapping of compatible historical versions of the Pylance and Python extensions. My recommendation would be to update to the latest of both.

I understand, but the versions I'm using are the latest ones, aren't they?

@debonte
Copy link
Contributor

debonte commented Aug 17, 2024

Oh, I'm sorry. I forgot that the Python extension has a different versioning scheme than us. I was interpreting xxxx.12.3 as a December release and didn't even look at the year.

It's the build provided by my package manager, so not the official one. vscode is version 1.91.1

Is this VS Code OSS then? Pylance is only supported in the official builds. Try downloading and installing from the VS Code website and I think you'll find that it works.

@ljnsn
Copy link

ljnsn commented Aug 17, 2024

Yes, it's a version of VS Code OSS. I previously never had any issues with Pylance/Python on this build, even though it's not officially supported. I'll wait for an update from the repo maintainer and see if it works with 1.92.x, otherwise I'll have to keep it updated myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests