visual-studio-codevirtualenvuv

VS Code settings to detect virtual environment created by UV


Unlike conda, UV create virtual environments under the project, with respect to their name. I have a fresh Mac, installed Cursor which is a variant of VS Code; when I open a Jupyter notebook, it has that "select kernel" but I can't see my own "virtual environment" that I have created.

I played with "Venv Path" and "Venv Folder" but I am not sure I am doing it correctly.


Solution

  • You need to install the kernel so that it can be found:

    uv run python -m ipykernel install --user --name "$NAME"
    

    Similar to How to install a new Jupyter Kernel from script or Installing a ipykernel and running jupyter notebook inside a virtual env - not using conda