{"id":555,"library":"plotly","title":"Plotly","description":"Plotly is an interactive, open-source data visualization library for Python, built on top of the Plotly JavaScript library (plotly.js). It supports over 40 unique chart types, enabling users to create rich, interactive web-based visualizations that can be displayed in Jupyter notebooks, saved as standalone HTML files, or integrated into pure Python web applications using Dash. Currently at version 6.6.0, Plotly maintains an active development and release cadence.","status":"active","version":"6.6.0","language":"python","source_language":"en","source_url":"https://github.com/plotly/plotly.py","tags":["data visualization","interactive plots","plotting","graphing","charts","jupyter","dash","scientific visualization"],"install":[{"cmd":"pip install plotly","lang":"bash","label":"Basic Installation"},{"cmd":"pip install 'plotly[kaleido]' # For static image export\npip install plotly-geo # For extended geographic features","lang":"bash","label":"With Optional Dependencies"}],"dependencies":[{"reason":"Recommended for static image export (PNG, JPEG, SVG, PDF) of figures.","package":"kaleido","optional":true},{"reason":"Provides extended geographic shape files for certain choropleth maps and other geo-specific features.","package":"plotly-geo","optional":true},{"reason":"Commonly used for data preparation and input with Plotly Express functions.","package":"pandas","optional":true}],"imports":[{"note":"This is the high-level API and the recommended starting point for most common plots.","symbol":"plotly.express","correct":"import plotly.express as px"},{"note":"This is the low-level API for fine-grained control over figures, traces, and layout, often used for complex or highly customized charts.","symbol":"plotly.graph_objects","correct":"import plotly.graph_objects as go"},{"note":"Used for input/output operations like displaying figures or writing them to various formats (e.g., HTML, JSON, images).","symbol":"plotly.io","correct":"import plotly.io as pio"}],"quickstart":{"code":"import plotly.express as px\n\n# Create a simple bar chart\nfig = px.bar(x=[\"A\", \"B\", \"C\"], y=[1, 3, 2], title=\"My First Plotly Chart\")\n\n# Display the figure (opens in browser/notebook)\nfig.show()","lang":"python","description":"This quickstart demonstrates creating a basic bar chart using `plotly.express`, the high-level API. The `fig.show()` method renders the interactive plot, typically in a browser or Jupyter environment."},"warnings":[{"fix":"Upgrade your Jupyter Notebook installation to version 7.0 or newer (e.g., `pip install --upgrade notebook`).","message":"Plotly.py 6.0 dropped support for Jupyter Notebook versions prior to 7.0. Users on older Jupyter versions will need to upgrade.","severity":"breaking","affected_versions":"6.0.0 and later"},{"fix":"Review code interacting directly with Pandas DataFrames if experiencing unexpected behavior or performance changes after upgrading. Consider adopting the dataframe interchange protocol for broader compatibility.","message":"Plotly.py 6.0 introduced a rewrite of dataframe performance using the Narwhals abstraction layer instead of solely relying on the Pandas API. While generally providing performance gains, this might subtly affect direct Pandas dataframe interactions for users upgrading from older versions.","severity":"breaking","affected_versions":"6.0.0 and later"},{"fix":"Consult the Plotly.js 3.0 changelog for replacement attributes or alternative trace types if using any of the removed features.","message":"Plotly.js 3.0 (which plotly.py 6.0 is built upon) removed support for several deprecated attributes (e.g., `titlefont`, `titleposition`, `titleside`, `titleoffset`) and specific trace types like `pointcloud` and `heatmapgl`.","severity":"breaking","affected_versions":"6.0.0 and later"},{"fix":"Install `kaleido` (`pip install -U kaleido`) for reliable static image export. Remove any reliance on `orca`.","message":"For static image export of Plotly figures (e.g., to PNG, JPEG, SVG, PDF), the `kaleido` package is the recommended engine since Plotly 4.9. The older `orca` command-line utility is now considered legacy and may have compatibility issues.","severity":"gotcha","affected_versions":"4.9.0 and later"},{"fix":"For most common plotting needs, start with `plotly.express`. Use `plotly.graph_objects` when `plotly.express` doesn't provide the necessary customization or for highly specialized plots (e.g., certain 3D trace types, complex subplots with different types).","message":"When creating figures, `plotly.express` automatically infers sensible defaults and is much more concise (5-100 times less code) than building figures directly with `plotly.graph_objects`. Using `go` requires explicit definition of traces and layout.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T15:05:52.933Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install Plotly using pip: `pip install plotly`","cause":"The Plotly library is not installed in the current Python environment where the code is being executed.","error":"ModuleNotFoundError: No module named 'plotly'"},{"fix":"Upgrade Plotly to the latest version using pip: `pip install --upgrade plotly`. Also ensure the `Figure` object is correctly instantiated and not `None`.","cause":"This error typically occurs when using an older version of Plotly (prior to v4.0) where the `.show()` method for displaying figures was not implemented or if the Figure object itself is `None` due to a previous error.","error":"AttributeError: 'Figure' object has no attribute 'show'"},{"fix":"Add the import statement `import plotly.express as px` at the beginning of your script or notebook cell.","cause":"The `plotly.express` module, commonly aliased as `px`, has not been imported before being used in the code.","error":"NameError: name 'px' is not defined"},{"fix":"Change `go.figure()` to `go.Figure()` when instantiating a graph object figure.","cause":"This error occurs due to incorrect capitalization. The class name for creating a figure from `plotly.graph_objects` is `Figure` (with a capital 'F'), not `figure` (lowercase 'f').","error":"AttributeError: module 'plotly.graph_objects' has no attribute 'Figure'"},{"fix":"Ensure `plotly` and `jupyterlab` are up-to-date (`pip install --upgrade plotly jupyterlab`). Install JupyterLab extensions (`jupyter labextension install jupyterlab-plotly @jupyter-widgets/jupyterlab-manager`) and restart Jupyter Lab. For some versions, downgrading JupyterLab might be a temporary workaround.","cause":"This can be caused by various factors, including an unresponsive kernel, outdated Plotly or Jupyter packages, browser compatibility issues, missing or incorrectly installed JupyterLab extensions (`jupyterlab-plotly` and `plotlywidget`), or an outdated `plotly.js` rendering engine.","error":"Plotly charts not showing in Jupyter Notebook/Lab (empty space)"}],"ecosystem":"pypi","meta_description":null,"install_score":80,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"kaleido","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}