Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tree drawing doesn't work on a headless server #1887

@DavidNemeskey

Description

@DavidNemeskey

nltk.tree.Tree uses the Tcl (tkinter) backend to draw trees. Unfortunately, that doesn't seem to work on a headless server, which is the setup I use: run Jupyter on the server and access it via the browser from another machine.

If python3-tk is not installed, I get

ImportError: No module named '_tkinter', please install the python3-tk package

If it is, I get

TclError: no display name and no $DISPLAY environment variable

However, dot works in such a setup, so it would be preferable if it was used as the backend instead of tk. Also, it could be used to implement _repr_svg_() on Tree, which would also be a very welcome addition, as svg is a much better format for these kinds of things than png.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions