Storing digits in python altair

I am trying to save altair shapes to html in any graphic format (png, svg).

  • HTML. Numbers in html are not displayed. Empty page

  • PNG. The docs say I need a package canvas

    and provide the command to install it for the conda. I don't have a conda. I am installing it system wide with npm install canvas

    . This gives a bunch of errors related to altair as such. Correcting them I still get:

FileNotFoundError: [Errno 2] No such file or directory: 'vl2svg'

FileNotFoundError: [Errno 2] No such file or directory: 'vl2png'

Any idea how to debug this?

+3


source to share


2 answers


The problem is Altair needs to access the npm command line tools in order to save the png / svg output. You need to make sure the vega-lite tools installed in npm are available in the environment your Python process is running in. Altair itself has no control over this, but tries to find them in the most likely locations (PATH followed by the binary install location as specified by npm, if available).

The errors above indicate that these executables are not available in the environment from which you started your Python process. You must update your PATH so that the command line tools are available, then start Python and run your Altair code.



Finally, there is another complication that is not related to this error, but which you are most likely to run into if you fix it: Vega-Lite is in the middle of a backward incompatible 2.0 release, and Altair is currently only running 1.0. You will need to install the Vega-Lite 1.0 related npm tools for this to work with the current version of Altair. Hopefully this summer we can update Altair to work with Vega-Lite 2.0.

+1


source


Several steps have been taken to fix it. Some of them:

  • Download and install the most recent mode in dev mode.
  • Install vega-lite

    repository: npm install vega-lite

    vl2png

    and it looks like, vega-lite

    not a canvas as I understood it.


The issue was raised here .

0


source







All Articles