Jupyter Kernel Gateway is a web server for spawning and communicating with Jupyter kernels. It provides a REST API that allows execution of code in Jupyter Kernels and manages their lifecycle, often used to expose notebooks as RESTful APIs. The current version is 3.0.1, and the project maintains an active release cadence with several updates per year, now managed under the `jupyter-server` organization.
pip install jupyter-kernel-gatewayNo compatibility data collected yet for this library.
This quickstart demonstrates how to programmatically start the Jupyter Kernel Gateway server and make a simple API request to verify its operation. In typical use, Kernel Gateway is run directly from the command line using `jupyter kernelgateway`.
Review custom code and remove any dependencies on `ipython_genutils` modules. Migrate to equivalent functionality in `traitlets` or standard Python libraries.
Upgrade `jupyter-kernel-gateway` to version 3.0.0 or later, which has updated dependency requirements. Alternatively, ensure your `jupyter-client` version is compatible (e.g., `<8`) when using older `jupyter-kernel-gateway` versions.
Always review and configure `KernelGatewayApp` settings, especially `ip`, `port`, `allow_origin`, and `auth_token` or other authentication mechanisms suitable for your deployment scenario. Consult the official documentation for comprehensive security guidelines.
Ensure `jupyter_kernel_gateway` is installed in the correct environment by running: `pip install jupyter_kernel_gateway` or `python -m pip install jupyter_kernel_gateway` if within a notebook context.
Check for other processes using port 8888 (the default for Kernel Gateway) and stop them, or specify a different port using `--KernelGatewayApp.port=<PORT>`. If `tornado` is the issue, downgrade it: `pip uninstall tornado` then `pip install tornado==5.1.1` (or a version compatible with your `jupyter-kernel-gateway` installation).
Review the Kernel Gateway logs for more specific errors. Increase resource allocations for kernels if running in a containerized environment (e.g., Kubernetes). Check kernel specifications (`jupyter kernelspec list`) and ensure they point to valid Python executables and dependencies. Adjust client-side timeouts (e.g., `GatewayClient.request_timeout`) if the kernels take a long time to start.
Ensure that `jupyter kernelgateway` is started with appropriate authentication settings, such as `--KernelGatewayApp.token='YOUR_TOKEN'` or `--KernelGatewayApp.password='YOUR_PASSWORD'`. If listing kernels is desired, enable it explicitly with `--KernelGatewayApp.list_kernels=true`. For cross-origin requests, configure `--KernelGatewayApp.allow_origin='*'` or specific origins.