Pylance Server Crashing

2024-07-16 12:50:55.638 [info] [Info - 12:50:55 PM] (26616) Pylance language server 2024.6.1 (pyright version 1.1.364, commit 0618acc5) starting
2024-07-16 12:50:55.849 [info] [Info - 12:50:55 PM] (26616) Server root directory: file:///c%3A/Users/dylan/.cursor/extensions/ms-python.vscode-pylance-2024.6.1/dist
2024-07-16 12:50:55.861 [info] [Error - 12:50:55 PM] Server initialization failed.
2024-07-16 12:50:55.861 [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
2024-07-16 12:50:55.862 [info] [Error - 12:50:55 PM] Pylance client: couldn’t create connection to server.
2024-07-16 12:50:55.862 [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
2024-07-16 12:50:57.976 [info] [Info - 12:50:57 PM] Connection to server got closed. Server will restart.
2024-07-16 12:50:57.976 [info] true
2024-07-16 12:50:58.472 [info] [Info - 12:50:58 PM] (8448) Pylance language server 2024.6.1 (pyright version 1.1.364, commit 0618acc5) starting
2024-07-16 12:50:58.473 [info] [Info - 12:50:58 PM] (8448) Server root directory: file:///c%3A/Users/dylan/.cursor/extensions/ms-python.vscode-pylance-2024.6.1/dist
2024-07-16 12:50:58.480 [info] [Error - 12:50:58 PM] Server initialization failed.
2024-07-16 12:50:58.481 [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
2024-07-16 12:50:58.481 [info] [Error - 12:50:58 PM] Pylance client: couldn’t create connection to server.
2024-07-16 12:50:58.481 [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
2024-07-16 12:50:58.481 [info] [Error - 12:50:58 PM] Restarting server failed
2024-07-16 12:50:58.481 [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
2024-07-16 12:51:00.606 [info] [Info - 12:51:00 PM] Connection to server got closed. Server will restart.
2024-07-16 12:51:00.606 [info] true
2024-07-16 12:51:01.458 [info] [Info - 12:51:01 PM] (6020) Pylance language server 2024.6.1 (pyright version 1.1.364, commit 0618acc5) starting
2024-07-16 12:51:01.458 [info] [Info - 12:51:01 PM] (6020) Server root directory: file:///c%3A/Users/dylan/.cursor/extensions/ms-python.vscode-pylance-2024.6.1/dist
2024-07-16 12:51:01.471 [info] [Error - 12:51:01 PM] Server initialization failed.
2024-07-16 12:51:01.472 [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
2024-07-16 12:51:01.472 [info] [Error - 12:51:01 PM] Pylance client: couldn’t create connection to server.
2024-07-16 12:51:01.472 [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
2024-07-16 12:51:01.472 [info] [Error - 12:51:01 PM] Restarting server failed
2024-07-16 12:51:01.472 [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
2024-07-16 12:51:03.754 [info] [Info - 12:51:03 PM] Connection to server got closed. Server will restart.
2024-07-16 12:51:03.754 [info] true
2024-07-16 12:51:04.708 [info] [Info - 12:51:04 PM] (25368) Pylance language server 2024.6.1 (pyright version 1.1.364, commit 0618acc5) starting
2024-07-16 12:51:04.709 [info] [Info - 12:51:04 PM] (25368) Server root directory: file:///c%3A/Users/dylan/.cursor/extensions/ms-python.vscode-pylance-2024.6.1/dist
2024-07-16 12:51:04.720 [info] [Error - 12:51:04 PM] Server initialization failed.
2024-07-16 12:51:04.720 [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
2024-07-16 12:51:04.721 [info] [Error - 12:51:04 PM] Pylance client: couldn’t create connection to server.
2024-07-16 12:51:04.721 [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
2024-07-16 12:51:04.721 [info] [Error - 12:51:04 PM] Restarting server failed
2024-07-16 12:51:04.721 [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
2024-07-16 12:51:06.821 [info] [Info - 12:51:06 PM] Connection to server got closed. Server will restart.
2024-07-16 12:51:06.821 [info] true
2024-07-16 12:51:07.715 [info] [Info - 12:51:07 PM] (20928) Pylance language server 2024.6.1 (pyright version 1.1.364, commit 0618acc5) starting
2024-07-16 12:51:07.715 [info] [Info - 12:51:07 PM] (20928) Server root directory: file:///c%3A/Users/dylan/.cursor/extensions/ms-python.vscode-pylance-2024.6.1/dist
2024-07-16 12:51:07.730 [info] [Error - 12:51:07 PM] Server initialization failed.
2024-07-16 12:51:07.731 [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
2024-07-16 12:51:07.731 [info] [Error - 12:51:07 PM] Pylance client: couldn’t create connection to server.
2024-07-16 12:51:07.731 [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
2024-07-16 12:51:07.731 [info] [Error - 12:51:07 PM] Restarting server failed
2024-07-16 12:51:07.732 [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
2024-07-16 12:51:09.892 [info] [Error - 12:51:09 PM] The Pylance server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

2 Likes

Just downloaded it and wanted to try everything out before upgrading my plan but I can’t even get the codebase chat to work? And I get the lance server errors when I start the application!

I couldn’t get any of the python servers that come with the ms-python extension to work. jedi, pylance and pyright each had their own issue.

What did work though was installing the BasedPyright extension and just using that. I found by default it actually did a little bit too much, here’s the config I’m using now in my pyproject.toml:

[tool.basedpyright]
typeCheckingMode = "standard"
reportIncompatibleMethodOverride = false
reportArgumentType = false
reportUnreachable = true
reportCallIssue = false
1 Like

What version do you have of Cursor, pylance, and python?

Also getting this issue. I have v2024.8.1 pylance and just updated to the latest cursor yesterday. Uswing at least 3.11 python