-
Notifications
You must be signed in to change notification settings - Fork 33
altair is not able to save png, even with a proper geckodriver and fierfox instalation #72
Comments
This is the whole trackback:
|
Try like this: chart.save('chart.png', webdriver='firefox') |
Wow, Jake! This solves the problem! Additionally, I get a page not found warning, but I am sure this not from altair, although maybe it is of interest: WARNING:tornado.access:404 GET /favicon.ico (::1) 0.31ms Thank you! Would it be helpful when I update docstring or documentation with the webdriver parameter information? |
@jakevdp can this be configured globally somehow? I'm running altair in Rmarkdown which uses reticulate and saves to PNG automatically so I think I don't have control over how images are saved. |
I tried with a custom renderer but that gets circumvented by a direct call in My attempt at a custom renderer: from altair_saver import render
def custom_altair_renderer(spec, **kwargs):
return render(spec, webdriver="firefox", **kwargs)
alt.renderers.register("custom_altair_renderer", custom_altair_renderer)
alt.renderers.enable('custom_altair_renderer', fmts=['vega-lite', 'png']) Traceback from knitting the Rmarkdown to markdown.
|
I now see that something goes wrong in the selenium driver selection. There is a
but So the final message I see is just
which initially made me believe that the geckodriver was not being looked for. |
I have very liberally added In the |
And indeed if I instead set the default argument to |
Thanks for digging into the issue – I've never actually tried |
I ran into a similar issue when I was trying to save in a Jupyter notebook launched from
So maybe OP needs to add the path to |
* fix: remove webdriver default argument to save Fix altair-viz/altair_saver#72 * style: apply latest black formatting Co-authored-by: Mattijn van Hoek <mattijn@gmail.com>
Closed in vega/altair#2466 |
Hi There,
I run python 3.8.2, altair 19.3.0, altair-saver 19.3.0, selenium 3.141.0, geckodriver 0.26.0, firefox 77.01, no chromedriver, no chrome browser.
I can run all the three examples from the selenium pip page. Everything works:
https://pypi.org/project/selenium/
So I think the error is not in my selenium, geckodriver, of firefox installation.
But when I try to chart.save('this_is_my.png') I get the following error:
Somehow altair does not get that I like to use geckodriver and Firefox, not chrome driver and Chrome.
I tried to look for some setting in the save command, where I explicitly can set firefox, but I think it doesn't exist. Also, I had a look at altair_saver/savers/_selenium.py
So far I am not become savvy enough to understand where the error is happening.
Any help appreciated.
Thank you, Elmar
The text was updated successfully, but these errors were encountered: