3D chart fails in Databricks notebook; explicit ECharts 5.5.1 / ECharts GL 2.0.9 dependencies work
Author: processaddCreated Sep 29, 2026Updated Sep 29, 2026
Environment
- pyecharts version: 2.1.0
- Python version: 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]
- Databricks Runtime: client.6.2
Issue
In the environment above, I am trying to create a 3D bar chart in a Databricks notebook using pyecharts Bar3D and render_notebook(), with:
from pyecharts.globals import CurrentConfig, NotebookType
CurrentConfig.NOTEBOOK_TYPE = NotebookType.NTERACT
import random
from pyecharts import options as opts
from pyecharts.charts import Bar3D
from pyecharts.faker import Faker
data = [(i, j, random.randint(0, 12)) for i in range(6) for j in range(24)]
c = (
Bar3D()
.add(
"",
[[d[1], d[0], d[2]] for d in data],
xaxis3d_opts=opts.Axis3DOpts(Faker.clock, type_="category"),
yaxis3d_opts=opts.Axis3DOpts(Faker.week_en, type_="category"),
zaxis3d_opts=opts.Axis3DOpts(type_="value"),
)
.set_global_opts(
visualmap_opts=opts.VisualMapOpts(max_=20),
title_opts=opts.TitleOpts(title="repro"),
)
)
c.render_notebook()The title and color scale appear, but the 3D bars and axes do not render. The output reports:
Script error. (0:0)Using displayHTML(c.render_embed()) also fails. Changing the asset host to https://assets.pyecharts.org/assets/v5/ did not resolve the issue in my test.
What worked
I added below:
from pyecharts.globals import CurrentConfig, NotebookType
CurrentConfig.ONLINE_HOST = "https://cdn.jsdelivr.net/npm/"
register_files({
"echarts": ["[email protected]/dist/echarts.min", "js"],
"echarts-gl": ["[email protected]/dist/echarts-gl.min", "js"],
})After this change, the original chart rendered successfully without changing its data or chart options.
Question
Could this be a compatibility issue between the default ECharts and ECharts GL dependencies, or an issue with the hosted assets?
Source: pyecharts/pyecharts