Resolving Kernel Connection Failures in JetBrains DataSpell
Troubleshoot 'Kernel Not Found' and connection errors in JetBrains DataSpell. Learn how to align project interpreters with Jupyter kernels and fix missing ipykernel installations.
27 Mar 2026, 19:25 UTC

The Problem: 'No Kernel Selected' or 'Connection Failed'
When working with Jupyter Notebooks in DataSpell, you may encounter a state where the notebook toolbar displays "No kernel selected" or a "Connection failed" error despite having a Python interpreter configured for the project. This prevents code execution and leaves the notebook in an inactive state.
The most common cause is a disconnect between the Project Interpreter (the Python executable DataSpell uses for indexing) and the Jupyter Kernel (the specific environment that executes the code cells). If the selected interpreter lacks the necessary Jupyter machinery, DataSpell cannot spawn the kernel process.
Diagnostic Matrix
| Symptom | Likely Cause | Primary Check |
|---|---|---|
| "No kernel selected" dropdown is empty | Missing ipykernel in environment |
Interpreter package list |
| Kernel hangs on "Starting" indefinitely | Version mismatch or zombie process | Event Log / System Monitor |
| "Connection failed" immediately after selection | Missing kernel spec file in user directory | jupyter kernelspec list |
Step-by-Step Diagnostic Workflow
-
Verify Interpreter Mapping
Ensure the project is actually using the environment you intend. Navigate to
Settings→Project: [Name]→Python Interpreter. Confirm the path points to your virtual environment (venv, conda, or poetry) rather than a generic system Python. -
Audit Environment Packages
Check the package list in the Interpreter settings. For a notebook to function, the following packages must be present in that specific environment:
jupyterandipykernel. If these are missing, DataSpell cannot bridge the IDE to the execution engine. -
Terminal Validation
Open the built-in terminal in DataSpell. Ensure the environment is activated (indicated by the environment name in parentheses in the prompt). Run the following command to see if the Jupyter server can initialize manually:
jupyter notebook --versionIf this returns a "command not found" error, the environment is incorrectly configured or the PATH is not updated.
Applied Fixes
Fix A: Installing Missing Kernel Components
If the audit revealed missing packages, install them directly into the active environment. Run this command in the DataSpell terminal (ensure you have write permissions for the environment folder):
pip install jupyter ipykernel
Risk: Avoid installing these into the global system Python (e.g., /usr/bin/python) as this often leads to PermissionError or breaks system-level dependencies.
Fix B: Manually Registering the Kernel Spec
Sometimes the packages exist, but the Jupyter configuration does not know how to find the specific Python executable. You can force-register the kernel by running the following in the terminal:
python -m ipykernel install --user
This creates a kernel.json file in your user data directory, which tells the Jupyter server exactly which Python binary to use for this kernel.
Verification and Testing
To confirm the fix, follow these steps:
- Click the kernel selection dropdown in the top right of the notebook editor.
- Select the interpreter you just modified.
- Create a new cell and execute:
print("Kernel Active"). - If the cell executes and displays the output, the connection is restored.
If the issue persists, open the Event Log (bottom right of the IDE) to check for specific traceback errors. Look for Tornado or ZMQ errors, which typically indicate a port conflict or a firewall blocking the local connection between the IDE and the kernel.
When to Escalate
If the following conditions are met, the issue is likely an IDE bug or a deep OS conflict rather than a configuration error:
- The kernel works perfectly in a standalone browser-based Jupyter Notebook but fails inside DataSpell using the same environment.
- The Event Log shows
java.io.IOExceptionduring the kernel startup phase. - Reinstalling the
ipykernelpackage does not change the "Starting" hang state.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.