question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`export_svgs`: Error - Unable to load Atom 'execute_script' from file ':/ghostdriver/./third_party/webdriver-atoms/execute_script.js'

See original GitHub issue

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

$ uname -a
Linux lap15 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ pip3 show bokeh
Name: bokeh
Version: 1.0.4
$ pip3 show notebook
Name: notebook
Version: 5.6.0

firefox 68.0 (64-bit)

Description of expected behavior and the observed behavior

Expect to see svg file exported, observed error: Error - Unable to load Atom 'execute_script' from file ':/ghostdriver/./third_party/webdriver-atoms/execute_script.js'

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.plotting import figure, output_file
from bokeh.io.export import export_svgs
fig = figure()
output_file('example.html') 
fig.output_backend = "svg"
export_svgs(fig, filename="par_eff_avg.svg")

Stack traceback

---------------------------------------------------------------------------
WebDriverException                        Traceback (most recent call last)
<ipython-input-2-b29a426bf4d1> in <module>
      2 output_file('example.html')
      3 fig.output_backend = "svg"
----> 4 export_svgs(fig, filename="par_eff_avg.svg")

~/.local/lib/python3.6/site-packages/bokeh/io/export.py in export_svgs(obj, filename, height, width, webdriver)
    128 
    129     '''
--> 130     svgs = get_svgs(obj, height=height, width=width, driver=webdriver)
    131 
    132     if len(svgs) == 0:

~/.local/lib/python3.6/site-packages/bokeh/io/export.py in get_svgs(obj, driver, **kwargs)
    230         web_driver.get("file:///" + tmp.path)
    231 
--> 232         wait_until_render_complete(web_driver)
    233 
    234         svgs = web_driver.execute_script(_SVG_SCRIPT)

~/.local/lib/python3.6/site-packages/bokeh/io/export.py in wait_until_render_complete(driver)
    276 
    277     try:
--> 278         WebDriverWait(driver, 5, poll_frequency=0.1).until(is_bokeh_loaded)
    279     except TimeoutException as e:
    280         raise_from(RuntimeError('Bokeh was not loaded in time. Something may have gone wrong.'), e)

~/.local/lib/python3.6/site-packages/selenium/webdriver/support/wait.py in until(self, method, message)
     69         while True:
     70             try:
---> 71                 value = method(self._driver)
     72                 if value:
     73                     return value

~/.local/lib/python3.6/site-packages/bokeh/io/export.py in is_bokeh_loaded(driver)
    273             const b = window.Bokeh;
    274             return b && b.documents && b.documents.length > 0;
--> 275         ''')
    276 
    277     try:

~/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute_script(self, script, *args)
    634         return self.execute(command, {
    635             'script': script,
--> 636             'args': converted_args})['value']
    637 
    638     def execute_async_script(self, script, *args):

~/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
    319         response = self.command_executor.execute(driver_command, params)
    320         if response:
--> 321             self.error_handler.check_response(response)
    322             response['value'] = self._unwrap_value(
    323                 response.get('value', None))

~/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
    206             if exception_class == ErrorInResponseException:
    207                 raise exception_class(response, value)
--> 208             raise exception_class(value)
    209         if message == "" and 'message' in value:
    210             message = value['message']

WebDriverException: Message: Error - Unable to load Atom 'execute_script' from file ':/ghostdriver/./third_party/webdriver-atoms/execute_script.js'

Screenshots or screencasts of the bug in action

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Jul 27, 2019

@freifrauvonbleifrei Given that those versions should, be fine, my only conclusion is that this must be some sort of installation issue on your end. This seems to be borne out in reports online that phantomJS installed via apt is not complete/functional:

https://stackoverflow.com/questions/36770303/unable-to-load-atom-find-element

There’s nothing we can do about that. Please install phantomJS via one of the other methods listed in those answers. If issues still persists, please open a topic on the discourse as helping with install issues is definitely a support issue https://discourse.bokeh.org/

0reactions
freifrauvonbleifreicommented, Jul 27, 2019

Yes, seems I installed it through apt:

$ phantomjs --version
2.1.1
$ whereis phantomjs
phantomjs: /usr/bin/phantomjs /usr/lib/phantomjs /usr/share/man/man1/phantomjs.1.gz
Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - Unable to load Atom ''find_element" - Stack Overflow
The reason is that I used apt-get install Phantomjs to install it, but it seems that it is a not full-functional Phantomjs version...
Read more >
tabs.executeScript doesn't work with remote files
Error during tabs.executeScript: Failed to load file: "http:// www.foo.com/myScript.js". chrome/ExtensionProcessBindings:95
Read more >
scripting.executeScript() - Mozilla - MDN Web Docs
A JavaScript function to inject. This function is serialized and then deserialized for injection. This means that any bound parameters and ...
Read more >
chrome.scripting - Chrome Developers
Use the chrome.scripting API to execute script in different contexts. ... The following code will inject the file script.js into the main frame...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found