Pylance breaks on Cursor 0.38.1

Since upgrading to Cursor v0.38.1, my Pylance extension has been broken and I have been unable to find a fix, despite installing and trying out many different versions of both the Python and Pylance extensions. I’ve also tried creating new profiles, but no luck.

Any help would be greatly appreciated, at this point I’m about to just give up on using Cursor if I can’t get my basic linting set up. If possible, I would like to revert to an earlier version of Cursor.

Cursor Python Language Server output:

2024-07-31 12:16:57.078 [info] [Info  - 12:16:57 PM] (61112) Pylance language server 2024.7.103 (pyright version 1.1.373, commit ee424479) starting
2024-07-31 12:16:57.078 [info] [Info  - 12:16:57 PM] (61112) Server root directory: file:///Users/thet/.cursor/extensions/ms-python.vscode-pylance-2024.7.103/dist
2024-07-31 12:16:57.081 [info] [Error - 12:16:57 PM] Server initialization failed.
2024-07-31 12:16:57.081 [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-31 12:16:57.081 [info] [Error - 12:16:57 PM] Pylance client: couldn't create connection to server.
2024-07-31 12:16:57.081 [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 

Cursor info:

Version: 0.38.1
VSCode Version: 1.91.1
Commit: 39ded7305e8d625076ebbbf98510c53152232660
Date: 2024-07-25T20:18:41.490Z
Electron: 29.4.0
ElectronBuildId: undefined
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.4.0
2 Likes

also have experienced this issue since I installed cursor a few days ago - seems to basically break python support, other than some basic syntax highlighting

1 Like

sorry yall! will investigate and report back

3 Likes

Me and a few colleagues all found the same thing. There’s a pyright replacement in the extensions called basedpyright that seems to do the job. It’s a bit more aggressive though, and we had to turn some features off to get similar functionality. But ideally cursor should fix this, it’s a table stakes feature

1 Like

Not sure building your own IDE is the right path if you can’t guarantee that basic features work out of the box.

I was very excited trying out the product but having to spend 60mim trying to install python and get pylance to work is antinomic to AI productivity gains.

Well at least I learned why Pylance was in the process!

1 Like

@parisetflorian It happens even to JetBrains. Yet totally agree: it feels awful to trade 1h of your life you got from AI coding, to investigate broken functionality in IDE x_x

Bumping this. Have emailed and opened a github issue with no response. All “solutions” are half-hearted hacks that don’t work or BasedPyright which doesn’t give Python symbols and is overzealous with types.

Cursor should really post a walkthrough of alternatives or using the Cursor Language Server which has no documentation that I can find. Python is much less usable after the Pylance breakage.

Posted screenshots and detailed notes in my github issue:

For those who don’t know, Pylance is being gatekept by Microsoft and they won’t license it to Cursor (or JetBrains, I think).

When they catch Cursor trying to include it in their IDE, they block it and send this 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.

Posting the last error here then canceling my Pro subscription. It’s clear the Cursor team is either legally disallowed from talking about this issue or just don’t care about customer service anymore. Either way, I’ll be back when and if these things change.

[21:27:38.795] [server] [21:27:51] Getting Manifest… ms-python.python
[21:27:38.968] [server] [21:27:51] Installing extension: ms-python.python {
[21:27:38.968] [server] installPreReleaseVersion: false,
[21:27:38.968] [server] context: { clientTargetPlatform: ‘win32-x64’ },
[21:27:38.968] [server] installOnlyNewlyAddedFromExtensionPack: true,
[21:27:40.885] [server] [21:27:53] Getting Manifest… anysphere.pyright
[21:27:41.921] [server] [21:27:54] Started downloading extension: ms-python.python 2023.14.0 file:///home/mocap/.cursor-server/data/CachedExtensionVSIXs/cursor-ms-python.python-2023.14.0-universal
[21:27:42.263] [server] [21:27:55] Failed downloading sigzip. End of central directory record signature not found. Either not a zip file, or file is truncated… Retry again… ms-python.python
[21:27:42.379] [server] [21:27:55] Failed downloading sigzip. End of central directory record signature not found. Either not a zip file, or file is truncated… Retry again… ms-python.python
[21:27:42.459] [server] [21:27:55] Error while installing the extension ms-python.python End of central directory record signature not found. Either not a zip file, or file is truncated. file:///home/mocap/.cursor-server/extensions/extensions.json
[21:27:43.472] [server] rejected promise not handled within 1 second: Extract: End of central directory record signature not found. Either not a zip file, or file is truncated.
[21:27:43.473] [server] stack trace: Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
[21:27:43.474] [server] at y (/home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/out/vs/server/node/server.main.js:114:25872)
[21:27:43.474] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/out/vs/server/node/server.main.js:114:27315
[21:27:43.474] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/index.js:40:7
[21:27:43.474] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/index.js:190:5
[21:27:43.475] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/index.js:712:5
[21:27:43.475] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/fd-slicer.js:33:7
[21:27:43.475] [server] at FSReqCallback.wrapper [as oncomplete] (node:fs:688:5)
[21:27:43.475] [server] [21:27:56] Error: End of central directory record signature not found. Either not a zip file, or file is truncated.
[21:27:43.476] [server] at y (/home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/out/vs/server/node/server.main.js:114:25872)
[21:27:43.476] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/out/vs/server/node/server.main.js:114:27315
[21:27:43.476] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/index.js:40:7
[21:27:43.476] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/index.js:190:5
[21:27:43.476] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/index.js:712:5
[21:27:43.476] [server] at /home/mocap/.cursor-server/cli/servers/Stable-274e2e5d572bd0b99449183635a0f94c7b9f54d0/server/node_modules/yauzl/fd-slicer.js:33:7
[21:27:43.476] [server] at FSReqCallback.wrapper [as oncomplete] (node:fs:688:5) {
[21:27:43.477] [server] code: ‘Extract’,
[21:27:43.477] [server] name: ‘Extract’
[21:27:43.478] [server] }

Same issues here. Have spent nearly an hour digging in and trying to get things working. This is sad because I like cursor but I can’t deal with this when I have work to do.

1 Like

OK, here’s how I fixed it.

  1. Remove ALL extensions
  2. Create a new user on your mac with admin role
  3. Log in as that user
  4. Install cursor with no plugins and no VSC link
  5. Install python which will give you: Python, Pylance, Python Debugger
  6. Go into the .cursor folder of that user and the extensions folder. Delete everything from the extensions folder of the original user and copy all files from the new users.
  7. Log back in from the original user and it should now work.

When I tried to install Pylance from the VSC marketplace website, downloading the VSIX file, it refused to load as it detected that it’s not VSCode.

For some reason the version that installs when you install Python, appears to be patched, allowing you to run it even though it’s not being run in VSCode. Note that you cannot find it by searching extensions within the app. But if you copy the files from a new install, they do work.

Feel like there should be a better way of installing this automatically.

Experiencing the same issue…

I fixed on my pc by put this to settings.json.

{
    "python.analysis.indexing": true,
    "python.analysis.packageIndexDepths": [
        {
            "name": "",
            "depth": 20,
            "includeAllSymbols": true
        }
    ]
}

has anyone found any solution for Windows? The only thing that works for me is to disable Pylance, close and reopen IDE, and finally enable Pylance. This is really suboptimal because I need to do it every time I start Cursor.

Is there a solution to this with any version combination of Cursor and Python extension?