# Error using export\_png

**URL:** <https://discourse.bokeh.org/t/error-using-export-png/2521>\
**Category:** Community Support\
**Created:** [October 11, 2017, 8:31pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521 "2017-10-11T20:31:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allan](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@Allan](https://discourse.bokeh.org/u/Allan)\
**Post date:** [October 11, 2017, 8:31pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/1 "2017-10-11T20:31:11Z")

</div>

I have a figure() object that I wish to save as a png.

However, I get this error

raise exception\_class(message, screen, stacktrace)  
selenium.common.exceptions.WebDriverException: Message: {“errorMessage”:“undefined is not an object (evaluating ‘window.Bokeh.documents’)”,“request”:{“headers”:{“Accept”:“application/json”,“Accept-Encoding”:“identity”,“Connection”:“close”,“Content-Length”:“393”,“Content-Type”:“application/json;charset=UTF-8”,“Host”:“127.0.0.1:54603”,“User-Agent”:“Python http auth”},“httpVersion”:“1.1”,“method”:“POST”,“post”:"{“script”: “\n // add private window prop to check that render is complete\n window.\_bokeh\_render\_complete = false;\n function done() {\n window.\_bokeh\_render\_complete = true;\n }\n\n var doc = window.Bokeh.documents[0];\n\n if (doc.is\_idle)\n done();\n else\n doc.idle.connect(done);\n “, “args”: , “sessionId”: “4cf03ab0-aec2-11e7-aea9-3beff2afffb4”}”,“url”:”/execute",“urlParsed”:{“anchor”:"",“query”:"",“file”:“execute”,“directory”:"/",“path”:"/execute",“relative”:"/execute",“port”:"",“host”:"",“password”:"",“user”:"",“userInfo”:"",“authority”:"",“protocol”:"",“source”:"/execute",“queryKey”:{},“chunks”:[“execute”]},“urlOriginal”:"/session/4cf03ab0-aec2-11e7-aea9-3beff2afffb4/execute"}}  
Screenshot: available via screen

``

I’ve installed the dependencies.

---

<div class="post-metadata">

**Author:** ![Allan](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@Allan](https://discourse.bokeh.org/u/Allan)\
**Post date:** [October 11, 2017, 8:34pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/2 "2017-10-11T20:34:29Z")

</div>

Maybe I can also add another question. I’m trying to enable multiple brushed regions on a plot that is linked. So for example brush one area, then brush another area, maybe with a different highlight color. Is this possible?

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 11, 2017, 8:37pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/3 "2017-10-11T20:37:35Z")

</div>

Please make separate posts for separate questions.

Thanks,

Bryan

> **···**
>
> > On Oct 11, 2017, at 15:34, Allan \<allaneivazian1@gmail.com\> wrote:
> > 
> > Maybe I can also add another question. I'm trying to enable multiple brushed regions on a plot that is linked. So for example brush one area, then brush another area, maybe with a different highlight color. Is this possible?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.  
> > To post to this group, send email to bokeh@continuum.io.  
> > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/5162802a-b75d-42ca-a416-e28bb4bd6f11%40continuum.io\](https://groups.google.com/a/continuum.io/d/msgid/bokeh/5162802a-b75d-42ca-a416-e28bb4bd6f11%40continuum.io%5C).  
> > For more options, visit [https://groups.google.com/a/continuum.io/d/optout\](https://groups.google.com/a/continuum.io/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 11, 2017, 8:38pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/4 "2017-10-11T20:38:21Z")

</div>

Hi,

In order to help, detailed version information for everything relevant will be needed,

Thanks,

Bryan

> **···**
>
> > On Oct 11, 2017, at 15:31, Allan \<allaneivazian1@gmail.com\> wrote:
> > 
> > I have a figure() object that I wish to save as a png.
> > 
> > However, I get this error
> > 
> > &nbsp;&nbsp;&nbsp;raise exception\_class(message, screen, stacktrace)  
> > selenium.common.exceptions.WebDriverException: Message: {"errorMessage":"undefined is not an object (evaluating 'window.Bokeh.documents')","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"393","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:54603","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"POST","post":"{\"script\": \"\\n // add private window prop to check that render is complete\\n window.\_bokeh\_render\_complete = false;\\n function done() {\\n window.\_bokeh\_render\_complete = true;\\n }\\n\\n var doc = window.Bokeh.documents[0];\\n\\n if (doc.is\_idle)\\n done();\\n else\\n doc.idle.connect(done);\\n \", \"args\": , \"sessionId\": \"4cf03ab0-aec2-11e7-aea9-3beff2afffb4\"}","url":"/execute","urlParsed":{"anchor":"","query":"","file":"execute","directory":"/","path":"/execute","relative":"/execute","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/execute","queryKey":{},"chunks":["execute"]},"urlOriginal":"/session/4cf03ab0-aec2-11e7-aea9-3beff2afffb4/execute"}}  
> > Screenshot: available via screen
> > 
> > I've installed the dependencies.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.  
> > To post to this group, send email to bokeh@continuum.io.  
> > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/1865f4d0-63e7-47a9-9855-9674b96c00eb%40continuum.io\](https://groups.google.com/a/continuum.io/d/msgid/bokeh/1865f4d0-63e7-47a9-9855-9674b96c00eb%40continuum.io%5C).  
> > For more options, visit [https://groups.google.com/a/continuum.io/d/optout\](https://groups.google.com/a/continuum.io/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Allan](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@Allan](https://discourse.bokeh.org/u/Allan)\
**Post date:** [October 11, 2017, 8:49pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/5 "2017-10-11T20:49:43Z")

</div>

I should mention I used conda-forge to install selenium. This gave me an error on selenium:

```auto
conda install selenium phantomjs pillow

Im on version 0.12.7 bokeh
and the package versions are I guess the latest

```

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 11, 2017, 8:59pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/6 "2017-10-11T20:59:52Z")

</div>

Hi,

I'm not trying to be unnecessarily short, but I'm not able to help with "I guess the latest". Detailed and complete version information for:

\* OS  
\* browsers  
\* python  
\* selenium  
\* phantomjs  
\* pillow  
\* bokeh

are all needed in order to even start to speculate, or to try and reproduce the problem so it can be investigated.

Otherwise I can only suggest: have you tried not installing from conda-forge? I have no control over what's there and can make no guarantees that the versions there are suitable.

Thanks,

Bryan

> **···**
>
> > On Oct 11, 2017, at 15:49, Allan \<allaneivazian1@gmail.com\> wrote:
> > 
> > and the package versions are I guess the latest

---

<div class="post-metadata">

**Author:** ![Allan](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@Allan](https://discourse.bokeh.org/u/Allan)\
**Post date:** [October 11, 2017, 9:14pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/7 "2017-10-11T21:14:41Z")

</div>

OS: macOS Sierra 10.12.6  
python: 3.6.2  
selenium: 3.6.0  
phantom: 2.1.1  
pillow: 4.2.1  
bokeh: 0.12.7

Apologies

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [October 11, 2017, 9:42pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/8 "2017-10-11T21:42:30Z")

</div>

So my version of selenium is in fact older:

❯ conda list selenium  
# packages in environment at /Users/bryan/anaconda:

> **···**
>
> #  
> pytest-selenium 1.6.0 py\_1 bokeh  
> selenium 3.4.3 py36\_0 conda-forge
> 
> It's possible something about the newer selenium is currently incompatible. My first suggestion is to downgrade selenium to the version above and see if that works,
> 
> Thanks,
> 
> Bryan
> 
> > On Oct 11, 2017, at 16:14, Allan \<allaneivazian1@gmail.com\> wrote:
> > 
> > OS: macOS Sierra 10.12.6  
> > python: 3.6.2  
> > selenium: 3.6.0  
> > phantom: 2.1.1  
> > pillow: 4.2.1  
> > bokeh: 0.12.7
> > 
> > Apologies
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.  
> > To post to this group, send email to bokeh@continuum.io.  
> > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/20f615b6-ff06-4929-9587-f1728553f78d%40continuum.io\](https://groups.google.com/a/continuum.io/d/msgid/bokeh/20f615b6-ff06-4929-9587-f1728553f78d%40continuum.io%5C).  
> > For more options, visit [https://groups.google.com/a/continuum.io/d/optout\](https://groups.google.com/a/continuum.io/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:13pm UTC](https://discourse.bokeh.org/t/error-using-export-png/2521/9 "2021-07-21T21:13:09Z")

</div>


