Troubleshooting¶
The cell shows problems instead of charts¶
The description could not be drawn. Each problem names the key it is about:
| Message | Fix |
|---|---|
no column "od60"; did you mean "od600"? |
the column name; it is matched without case or spacing, but not misspelt |
unknown key "colr"; did you mean "color"? |
the key; Description keys lists them all |
"x" and "x-axis" say the same thing; keep one |
two names for one key in one chart |
colouring by a column ("medium") works on point charts and bars; give a histogram one colour instead |
a histogram takes one colour; split it with a second chart instead |
bars split by a column need a category; "rate" is a number |
name the column in categorical, or colour by a category |
say what to draw: "x" (and "y", "z"), or "from" and "to" |
a chart named no columns |
"Time" could be any of "Time", "time"; write the name exactly |
two columns differ only by case or spacing |
/figure/format: one of svg, pdf, png |
figure needs a format |
sp.validate(description, data=df) returns the same problems as a list, without
drawing anything.
The charts are blank, or never appear¶
sp.viewprintedHTMLViewor a plain repr instead of charts. The frontend does not run widgets. Install thenotebookextra in the kernel's environment and restart the kernel; in classic Jupyter Notebook 6 and older, widgets also need that frontend's widget extension installed.- A chart shows axes but no points. All rows may be filtered out by another chart's brush: click that chart without dragging to clear it.
- A reopened notebook shows nothing. Widget output needs the kernel; run the cell again, or see Saving a notebook with its charts.
import spectacular imports something else¶
PyPI's spectacular is a different project. If it is installed, it shadows this one:
sp.__file__ shows which package was imported.
render fails¶
render draws figures in headless Chromium: pip install ...: install therenderextra and the browser:pip install "spectacular-charts[render]", thenpython -m playwright install chromium.Executable doesn't exist at ...(from Playwright): the browser was not installed for this environment; runpython -m playwright install chromiumwith the same Python.NotImplementedErrorin a notebook on Windows (0.2.0 only): ipykernel 6 switches asyncio to the selector event loop, which cannot start the browser. Upgrade withpip install -U spectacular-charts; from 0.2.1,renderuses an event loop of its own.- Slow: each figure starts a browser, a few seconds each. Draw many charts into one
figure with
chartsrather than many figures.
TypeError: dates and durations have no axis type yet¶
Convert the column to numbers first, such as hours since the start; see Data.
The native command is not found¶
spectacular is installed into the environment's scripts folder (bin on Linux and
macOS, Scripts on Windows). Activate the environment, or call it by its full path. The Python package
looks for it in this order:
- the
SPECTACULAR_BINenvironment variable; - the scripts folder of the running Python;
- the user scripts folder;
- next to the Python executable;
- a
target/build in a checkout; PATH.
Selections stay empty¶
selectionis filled by the page after you brush. Read it in a later cell than the one that showed the view.selected_rowsis empty withtrack_rows=False.selected_keysneeds akeyin the description.
Still stuck¶
Open an issue at
github.com/fullscreen-triangle/spectacular/issues
with the description, sp.__version__, and the output of sp.validate(description, data=df).