Skip to content

Instantly share code, notes, and snippets.

@joeblackwaslike
Last active May 27, 2025 19:24
Show Gist options
  • Save joeblackwaslike/752b26ce92e3699084e1ecfc790f74b2 to your computer and use it in GitHub Desktop.
Save joeblackwaslike/752b26ce92e3699084e1ecfc790f74b2 to your computer and use it in GitHub Desktop.
How to use python with the Cursor IDE

How to use python with the Cursor AI IDE

We are going to edit cursors settings to point to the microsoft extensions marketplace.

  1. Remove all extensions and exit Cursor.
  2. Locate your Cursor project.json file depending on your platform and open it.
    • On MacOS: /Applications/Cursor.app/Contents/Resources/app/product.json
    • On Windows: C:\Users\<user_name>\AppData\Local\Programs\cursor\resources\app\product.json
    • On Linux: /usr/lib/code/product.json
  3. Locate the object value for key extensionsGallery in the json document.

Contents of extensionsGallery key in product.json for Cursor

{
    "galleryId": "cursor",
    "serviceUrl": "https://marketplace.cursorapi.com/_apis/public/gallery",
    "itemUrl": "https://marketplace.cursorapi.com/items",
    "resourceUrlTemplate": "https://marketplace.cursorapi.com/{publisher}/{name}/{version}/{path}",
    "controlUrl": "",
    "recommendationsUrl": "",
    "nlsBaseUrl": "",
    "publisherUrl": ""
}
  1. Edit it to look like this:
{
    "galleryId": "cursor",
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "itemUrl": "https://marketplace.visualstudio.com/items",
    "resourceUrlTemplate": "https://{publisher}.vscode-unpkg.net/{publisher}/{name}/{version}/{path}",
    "controlUrl": "",
    "recommendationsUrl": "",
    "nlsBaseUrl": "",
    "publisherUrl": ""
}
  1. Reopen Cursor.app and install the following extensions:
    • ms-python.python
    • ms-python.vscode-pylance
    • ms-python.debugpy
  2. Make sure in your settings that python.languageServer is set to "Pylance"
  3. Re-sign Cursor.app (for MacOS)
codesign --force --deep --sign - /Applications/Cursor.app

Enjoy!

PS: you may need to goto your settings.json to remove any theme settings, because having a broken theme looks exactly like this same problem. In my case cursor had copied over my settings from vscode and they pointed to a theme that wasn't yet installed in cursor, removing and then setting the theme manually worked when I though for sure I had broken it again.

@gemnioo
Copy link

gemnioo commented May 8, 2025

does this method banned by $MSFT ?

[error] [Window] connect ECONNREFUSED 198.41.30.195:443: Error: connect ECONNREFUSED 198.41.30.195:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1611:16)
  "extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items",
    "controlUrl": "",
    "recommendationsUrl": ""
  }

@realdimas
Copy link

@gemnioo 198.41.30.195 is eclipse.dev – doesn't seems relevant to the issues discussed in this gist:

$ host 198.41.30.195
195.30.41.198.in-addr.arpa domain name pointer eclipse.dev.

@gemnioo
Copy link

gemnioo commented May 9, 2025

@gemnioo 198.41.30.195 is eclipse.dev – doesn't seems relevant to the issues discussed in this gist:

$ host 198.41.30.195
195.30.41.198.in-addr.arpa domain name pointer eclipse.dev.

double checked Gemini not hallucinations

This error repeats multiple times throughout the logs.

    ECONNREFUSED: This is a standard network error code meaning the connection was actively refused by the server at the specified address and port. The server received the connection attempt but declined it.

    198.41.30.195: This is an IP address associated with Microsoft services, specifically related to the Visual Studio Marketplace (where VS Code/code-server fetches extensions from).

    443: This is the standard port for HTTPS (secure web traffic).

@realdimas
Copy link

2025.4.100 is the most recent Pylance extension that is compatible with the current Cursor (tested with 0.50 versions).
The extension can be installed by dragging and dropping the .vsix file into the Extensions tab in Cursor.

Direct download link to the .vsix extension package:
https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/vscode-pylance/2025.4.100/vspackage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment