Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Jupyter kernels launched from Python virtual environments (.venv) freeze immediately upon startup or kernel restart, before executing any code cells.
The kernel process starts successfully and establishes network connections, but then hangs indefinitely during the initial handshake/communication phase with Cursor.
Key symptoms:
- Kernel starts (process visible, ports listening)
- Kernel establishes TCP connections to Cursor’s Node.js process
- Kernel freezes before executing even the first cell (
import io) - No error messages, kernel appears to be waiting indefinitely
- Same kernel works fine when launched outside Cursor (e.g., via
jupyter notebookCLI) - Standalone Python interpreters (not in venv) work fine in Cursor
- Issue is specific to venv-based kernels
Technical details from debugging:
- Kernel process (PID 4612) shows state:
S (sleeping)with 12 threads - All threads waiting on
epoll_wait()calls (normal I/O waiting) - TCP connections established: kernel listening on ports 9008-9012, connected to Cursor’s Node.js process (PID 1172)
- Reading from kernel’s stdout/stderr pipes causes infinite hang
- No messages being exchanged between Cursor and kernel (strace shows no
sendmsg/recvmsgactivity) - Python 3.13.0, ipykernel 7.1.0, pyzmq 27.1.0, tornado 6.5.4
Steps to Reproduce
-
Create a Python project with a virtual environment:
mkdir test-project cd test-project python3.13 -m venv .venv .venv/bin/pip install ipykernel pandas numpy -
Create a simple Jupyter notebook (
test.ipynb) with a single cell:import io -
Open the notebook in Cursor IDE
-
Select the
.venvPython interpreter as the kernel -
Try to execute the first cell
(NOTE: sometimes it works when the notebook is created for the first time, but it freezes after kernel restart or after closing the file and relaunching it / running it for the second time)
Expected Behavior
- Cell executes successfully
- Output shows execution completed
Operating System
Linux
Version Information
Version: 2.3.41 (system setup)
VSCode Version: 1.105.1
Commit: 2ca326e0d1ce10956aea33d54c0e2d8c13c58a30
Date: 2026-01-16T19:14:00.150Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100
Additional Information
Operating system:
WSL Ubuntu 24
Process analysis:
# Kernel process details
PID: 4612
Command: /path/to/.venv/bin/python -m ipykernel_launcher --f=/run/user/1000/jupyter/runtime/kernel-*.json
State: S (sleeping)
Threads: 12
Network connections:
- Kernel listening on: 127.0.0.1:9008-9012
- Connected to Cursor Node.js process (PID 1172)
- Connections established but no data exchange
System calls (strace):
- All threads waiting on
epoll_wait()- normal I/O waiting - No
sendmsg/recvmsgactivity (no ZMQ message exchange) - Reading from stdout/stderr pipes hangs indefinitely
What works:
- Same kernel works when launched via
jupyter notebookCLI - System Python (non-venv) kernels work in Cursor
- Kernel can be manually started:
.venv/bin/python -m ipykernel_launcherworks - Python imports work fine:
.venv/bin/python -c "import io"succeeds
What doesn’t work:
- Cursor launching venv kernel and establishing communication
- Executing any cells when using venv kernel
- Interrupting frozen kernel (must kill process manually)
Does this stop you from using Cursor
Yes - Cursor is unusable