nittolese / gquestions

Find "People Also Ask" questions
GNU General Public License v3.0
59 stars 36 forks source link

MacOS: Exec format error: 'driver/chromedriver' #3

Closed danyaljj closed 5 years ago

danyaljj commented 5 years ago

I am getting the following error:

Daniels-MBP-4:gquestions daniel$ python3.6 gquestions.py query "flights" en
{'--csv': False,
 '--headless': False,
 '--help': False,
 '<depth>': None,
 '<keyword>': 'flights',
 'depth': False,
 'en': True,
 'es': False,
 'query': True}
Traceback (most recent call last):
  File "gquestions.py", line 320, in <module>
    browser = initBrowser()
  File "gquestions.py", line 69, in initBrowser
    return webdriver.Chrome(options=chrome_options,executable_path=chrome_path)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: 'driver/chromedriver'

Any thoughts what is going on? Just for completeness:

Daniels-MBP-4:gquestions daniel$ chromedriver --version
ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770@{#1003}) 
nittolese commented 5 years ago

Hi Daniel, in the driver folder the executable is the one for Linux version. Could you try to remove the original driver/chromedriver and replace it with a version for MacOs?

Moreover, you should upgrade your Python installation to 3.7 because from that version dictionaries can "remember" the order of insertion (not related to this issue, though).

Let me know if you resolve replacing the original chromedriver in driver folder.

danyaljj commented 5 years ago

Thanks, it worked with ChromDrover 75 (76 failed) + Python 3.7.