Closed kliegr closed 1 year ago
not sure but maybe it has trouble viewing svg. If headless, this could be a problem with what's installed.
Thanks for the pointers. I resolved this as follows but partly it is a workaround. The first error (xdg-open: no method available for opening) was resolved by installing a web browser on the server:
sudo apt-get install w3m
This made the package render the svg and save it, but not display it. The probable reason is persisting error "Error: no "view" mailcap rules found for type "image/svg+xml". For this, the workaround is to load and display the saved file instead of calling `show' from dtreeviz.
from IPython.display import SVG, display
display(SVG('iris.svg'))
So it sounds like this is more or less resolved by making sure that the server, despite being headless, still has the required libraries in functionality. Thanks for posting as others will find this very useful
I struggle correctly configuring dtreeviz on Ubuntu 20.04.5 LTS. A possible reason is that it is run on a server machine with no GUI frontend via JupyterHub.
I installed with
as this did not found the "dot" folder, I also installed
Now with the hello world Iris example I get:
On another similar machine (same OS, also no UI), I also get