Peter
Peter

Reputation: 301

Python Selenium chromedriver OSError: [Errno 8] Exec format error

I'm trying to set up a chrome session with Selenium in my python (2.7) script like this:

from selenium import webdriver
driver=webdriver.Chrome()

But I get the following error:

Traceback (most recent call last):
File "soup_test.py", line 30, in <module>
driver=webdriver.Chrome()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__
self.service.start()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 62, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

Searching through other questions a common issue seems to be that chromedriver is not on the path, but I checked and it is. I even tried specifying the path explicitly:

driver=webdriver.Chrome("/path/to/chromedriver")

with the same result. Anyone know what could be the problem? I'd really appreciate the help!

Upvotes: 5

Views: 6797

Answers (1)

Peter
Peter

Reputation: 301

I eventually solved the problem by uninstalling all instances of chromedriver (I had multiple in different locations) and then installing it again with homebrew: brew install chromedriver

Upvotes: 2

Related Questions