{"id":10252,"library":"spyder-kernels","title":"Spyder Kernels","description":"Spyder-kernels provides the Jupyter kernels required for Spyder's console to run Python code. It enables Spyder to execute code in separate environments, ensuring isolation and flexibility for different projects. The current version is 3.1.4 and it typically releases new versions in sync with major Spyder IDE updates.","status":"active","version":"3.1.4","language":"en","source_language":"en","source_url":"https://github.com/spyder-ide/spyder-kernels","tags":["jupyter","spyder","kernel","ide","python-environment"],"install":[{"cmd":"pip install spyder-kernels","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[],"quickstart":{"code":"import sys\nprint(f\"Hello from Spyder kernel!\\nPython version: {sys.version}\")\n# This code would be run directly in the Spyder IDE's console.","lang":"python","description":"To use spyder-kernels, simply install it in the Python environment you wish Spyder to interact with. Once installed, launch Spyder and select that environment as your console's interpreter (e.g., via `Tools > Preferences > Python interpreter`). Then, execute code directly in the IPython console."},"warnings":[{"fix":"Consult the official Spyder documentation for the correct `spyder-kernels` version range compatible with your Spyder IDE. For Spyder 5.x, you generally need `spyder-kernels>=2.0,<3.0`. For Spyder 6.x, you need `spyder-kernels>=3.0`.","message":"Spyder-kernels versions are tightly coupled with Spyder IDE versions. Installing a `spyder-kernels` version incompatible with your Spyder IDE might lead to kernel startup failures or unexpected behavior.","severity":"breaking","affected_versions":"<2.0 (for Spyder 5.x), <3.0 (for Spyder 6.x)"},{"fix":"Activate your target environment (e.g., `conda activate my_project_env` or `source .venv/bin/activate`) and then run `pip install spyder-kernels`. Afterwards, configure Spyder to use this environment as its Python interpreter.","message":"To run code in a specific environment from Spyder, `spyder-kernels` must be installed in *that specific environment*, not just in the environment where Spyder itself is installed.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure `ipykernel` is up-to-date and compatible with your `spyder-kernels` version. A clean install within your environment (`pip install --upgrade ipykernel`) or ensuring `spyder-kernels` installs its recommended `ipykernel` dependency often resolves this.","message":"Mismatched or outdated `ipykernel` installations in the target environment can prevent the Spyder kernel from starting or cause it to crash.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Activate the desired Python environment and install `spyder-kernels`: `pip install spyder-kernels`. Then, ensure Spyder is configured to use this environment as its interpreter.","cause":"`spyder-kernels` is not installed in the Python environment currently selected by Spyder for its console.","error":"ModuleNotFoundError: No module named 'spyder_kernels'"},{"fix":"1. Verify `spyder-kernels` compatibility with your Spyder IDE version. 2. Ensure `ipykernel` is up-to-date in the target environment. 3. Try creating a fresh environment and installing only `spyder-kernels` and your project dependencies there.","cause":"This generic error often indicates an issue with the Python environment, a conflict between `spyder-kernels` and other packages (like `ipykernel`), or an incompatible `spyder-kernels` version for your Spyder IDE.","error":"Kernel died, restarting. The kernel crashed while executing code in the the console. This sometimes happens because of a bug in your code or in a package you are using. For more information, please check the console or the application log."},{"fix":"In the problematic environment, run `pip install --upgrade spyder-kernels ipykernel`. If the issue persists, try clearing Spyder's application data (as per Spyder's documentation, usually `~/.spyder-py3` or similar), or use a fresh Python environment.","cause":"Often due to an outdated `spyder-kernels` in the environment, or an `ipykernel` conflict preventing the kernel from properly initializing.","error":"Spyder is not starting up or console is unresponsive after environment change."}]}