I cannot select my venv python interpreter

I cannot select my python interpreter in the virtual environment in my project. I try to copy the absolute path to .venv/bin/python and I get

An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging. See output for more details regarding why the interpreter is invalid.

If I hop over to VS code it works 100% fine.

I am working on a Mac.

I tried reinstalling all python extensions and restarting Cursor.

3 Likes

+1, facing the same issue right now on Mac

1 Like

same issue

Same Issue

Same here.

And it’s stupid that terminal interpreter/project interpreter/Cursor Agent interpreter don’t change together to make sure consistency

1 Like

Here’s how I fixed it:

  1. I went to the Command Palette (Cmd+Shift+P) and selected Python: Select Interpreter .

  2. I chose the “Enter interpreter path…” option.

  3. I navigated to my project folder, then to the venv folder (or .venv), then to the bin subfolder, and selected the file named python or python3.

  • Example path:
/path/to/your/project/venv/bin/python

  1. After selecting that file, Cursor correctly recognized the virtual environment, and all features like Intellisense, linting, and debugging were enabled.

I hope this helps someone else with the same problem!

This is still an issue, works fine in VScode, but not in cursor. Setting direct path does nothing. Using uv commands works just fine, but i need this for debugger. On windows. Currently i just use VScode for Debugging.

Hi @frizzerdk, after setting the python interpreter, could you try reloading the window?

If you’re using a multi-root workspace, I’d try setting it at the workspace level rather than at the folder level.

still no luck, everything has been restarted and reloaded. But I have tried more experiments, it seems like my IT department does not have an exception for the cursor install folder, but it has for vs code. Thus the extentions can not run in some instances, finding the interpreter being one of them.

I wasn’t having this issue before, but suddenly am after updating to Cursor 2.1.49. Now Cursor’s Python LSP (Anysphere / basedpyright?) isn’t recognizing any third-party libraries:

My project’s venvs aren’t appearing in the Select Interpreter dialog:

And browsing to manually select my project’s venv path doesn’t result in any change, the bottom right of Cursor still shows Python 3.13.0 (homebrew) (/opt/homebrew/bin/python3 on hover), as if I’d done nothing:

Meanwhile things are working fine in VSCode. The correct venv shows up, and is even selected automatically:

It’s pretty workflow-blocking (errors everywhere lol) for every third-party import to remain unresolved, so if someone from the Cursor team has a moment to take a look or any ideas, that’d be greatly appreciated :folded_hands:

Edit: Oh actually, I found a workaround - I just had to specifically type in the venv path (and it had to be the venv folder path itself, i.e. /path/to/project/venv rather than /path/to/project/venv/bin/python3), rather than using “Find… Browse your file system to find a Python interpreter.” to select the interpreter.

There still seems to be at least one underlying Cursor bug, regarding not auto-detecting the venv, the “Find…” button not working properly, and having to manually enter the venv folder path rather than the python interpreter path. And my project’s venv disappears from the Select Interpreter dialog if I select a different interpreter again; I have to manually type the venv folder path again to switch back to it. But glad to have this workaround at least!