Peristent issues with Pylance

Hi,

it seems many users have had this problem, that the Pylance server doesn’t work in Cursor.

What do I do to fix this?

Best,
Marius

2024-08-28 18:18:19.182 [info] [Info - 18:18:19] (56459) Pylance language server 2024.8.1 (pyright version 1.1.373, commit ee424479) starting
2024-08-28 18:18:19.182 [info] [Info - 18:18:19] (56459) Server root directory: file:///Users/mc/.cursor/extensions/ms-python.vscode-pylance-2024.8.1/dist
2024-08-28 18:18:19.189 [info] [Error - 18:18:19] Server initialization failed.
2024-08-28 18:18:19.189 [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-08-28 18:18:19.189 [info] [Error - 18:18:19] Pylance client: couldn’t create connection to server.
2024-08-28 18:18:19.189 [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

I am a new user and have been struggling with this. I have tried everything people have stated here and still get buggy behavior and have to jump through hoops. I have yet to get a response from any moderators. This is a bummer as cursor is pretty cool but the fact that they don’t support this or have docs on how to solve this problem is insane. Its jut not useable at this point.

1 Like

The real issue comes down to Microsoft being exclusive. You can’t actually use Pylance outside of Microsoft as you see in your error message. My understanding is that Cursor has tried to do sneaky things to make it work but eventually it always breaks. This is just not sustainable. They are losing a TON of potential customers until they figure out a real solution. You just can’t barely half support one of the biggest coding languages in the world and have zero documentation explaining how to fix the problem. Hopefully enough people complain and it puts a fire under them because I think it really is an awesome product when you are not spending hours figuring out the mess. :stuck_out_tongue:

I would like to respond with a solution:

  1. Install basedpyright (documentation)
  2. follow the dialogue which says uninstall pyright and restart
  3. enjoy

Best,
Marius

Yeah this is the best you can do… but BasedPyright is not the same and I am not a fan of how it works. It also doesn’t do well with my job’s workspace setup for vscode so unfortunately I can’t really use cursor without jumping through some hoops.

1 Like