This is due to a conflict with recent versions of Jupyter. The solution is to use the pre-release version of the Jupyter extension and set up a local server:
1. Install the pre-release version of Jupyter
2. Set up your virtual environment (in the terminal):
.venv\Scripts\activate
python -m pip install --upgrade pip
pip install ipykernel jupyter
3. Start the Jupyter server:
jupyter notebook --no-browser
Copy the full URL that appears (example: `http://localhost:8888/?token=abc123...`)
4. Connect VS Code to the server:
• Open your notebook
• Click on the kernel selector
• Select “Select Another Kernel...” → “Existing Jupyter Server...”
• Paste the full URL (with the token)
• Press Enter
• Select the Python interpreter: .venv\Scripts\python.exe
And it should work now :D
Translated with DeepL.com (free version)