{"id":23926,"library":"k3d","title":"K3D Jupyter","description":"K3D is a Jupyter notebook extension for 3D visualization of meshes, points, voxels, and other geometric data using WebGL. Current version is 2.17.0, with occasional releases (last stable in 2023).","status":"active","version":"2.17.0","language":"python","source_language":"en","source_url":"https://github.com/K3D-tools/K3D-jupyter","tags":["3d","visualization","jupyter","webgl","notebook"],"install":[{"cmd":"pip install k3d","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Required for Jupyter integration","package":"ipywidgets","optional":false},{"reason":"Required for widget state management","package":"traitlets","optional":false}],"imports":[{"note":"k3d is the top-level module; do not import a submodule named k3d.","wrong":"from k3d import k3d","symbol":"k3d","correct":"import k3d"}],"quickstart":{"code":"import k3d\nimport numpy as np\n\n# Create a plot object\nplot = k3d.plot()\n\n# Generate some points\npoints = np.random.rand(100, 3).astype(np.float32)\ncolors = np.random.randint(0, 255, (100, 3), dtype=np.uint8)\n\n# Add a point cloud\npoint_cloud = k3d.points(positions=points, colors=colors, point_size=0.1)\nplot += point_cloud\n\n# Display the plot\nplot.display()","lang":"python","description":"Creates a 3D scatter plot with random points in a Jupyter notebook."},"warnings":[{"fix":"Ensure you have the k3d JupyterLab extension installed: `jupyter labextension install k3d`. For classic notebook, the extension is included.","message":"k3d requires Jupyter Notebook or JupyterLab with the lab extension enabled. In JupyterLab, run `jupyter labextension install k3d` if missing.","severity":"gotcha","affected_versions":"all"},{"fix":"Always create a new plot object for each visualization: `plot = k3d.plot()` before adding objects.","message":"The `k3d.plot()` object is a singleton-like pattern; reusing the same plot object without creating a new one can lead to stale renderings.","severity":"gotcha","affected_versions":"all"},{"fix":"For helix, use `k3d.line` with parametric coordinates. For text, consider using matplotlib or an overlay.","message":"The `k3d.helix` and `k3d.text` functions were deprecated in 2.14 and removed in 2.17. Use alternative methods for helix and text.","severity":"deprecated","affected_versions":">=2.17.0"},{"fix":"Cast positions to `np.float32` before passing: `positions=np.array(...).astype(np.float32)`.","message":"As of version 2.15, the `k3d.points` function changed its signature: `positions` expects a numpy array of dtype float32 explicitly.","severity":"breaking","affected_versions":">=2.15.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install k3d` or `conda install -c conda-forge k3d`.","cause":"k3d is not installed.","error":"ModuleNotFoundError: No module named 'k3d'"},{"fix":"Convert your array: `positions = np.array(your_data).astype(np.float32)`.","cause":"k3d >=2.15 enforces float32 dtype for point positions.","error":"ValueError: positions must be a numpy array with dtype float32"},{"fix":"Run `pip install ipywidgets` and in JupyterLab run `jupyter labextension install @jupyter-widgets/jupyterlab-manager`.","cause":"ipywidgets is missing or JupyterLab widget manager is not configured.","error":"Widget failed to display: K3D requires ipywidgets to be installed and enabled."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}