Comm is a low-level Python library providing the core implementation for Jupyter communications (Comms). It enables custom bidirectional messaging between a Jupyter kernel (like ipykernel or xeus-python) and its connected frontend. It is currently at version 0.2.3 and is actively maintained, with releases typically tied to Jupyter ecosystem updates.
pip install commVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the basic structure of using `comm.Comm` within a Python kernel in a Jupyter environment. It shows how to create a custom Comm class, register a message handler, and send/receive messages. Note that `comm` is a low-level library; actual communication requires a compatible frontend and a running Jupyter kernel. Running this code directly as a standalone Python script will not establish communication as there's no Jupyter `CommManager` present by default.
If your application relies on `traitlets` features that were implicitly provided by `comm` in older versions, ensure `traitlets` is explicitly installed (`pip install traitlets`) in your environment.
Ensure you are running `comm` within a Jupyter Notebook, JupyterLab, or an IPython kernel. For simpler Python-to-Python communication or general IPC, consider other libraries like `socket`, `multiprocessing`, `commlib-py`, or `pyserial`.
For common interactive UI patterns in Jupyter, use `ipywidgets`. Reserve direct `comm` usage for advanced custom communication protocols not covered by existing higher-level libraries.
Verify the correct `jupyter-comm` package is installed (e.g., `pip install jupyter-comm`). Check your Python environment for conflicting packages named `comm` (`pip show comm`). If `jupyter-comm` is already installed, try reinstalling it (`pip install --upgrade --force-reinstall jupyter-comm`) to ensure all components are properly in place.
If you intend to use the `Comm` class from the `comm` PyPI package, import it from `comm.base.Comm` (e.g., `from comm.base import Comm`). If you are working within a Jupyter kernel environment and need access to the `Comm` class as provided by the kernel, ensure you are importing it from `jupyter_client.session.Comm`.