1

I'm really new to coding and python. I have installed chromedriver on Mac, but when I try and launch a python script that is using it, it looks for the Windows version instead of Mac.

How can I force it to look for chromedriver instead of chromedriver.exe?

  File "<string>", line 120, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: 'chromedriver.exe'

This is line 73 of the webdriver.py where it thinks its Windows?

        cmd = [self.path]
        cmd.extend(self.command_line_args())
        self.process = subprocess.Popen(cmd, env=self.env,
                                        close_fds=platform.system() != 'Windows',
                                        stdout=self.log_file,
                                        stderr=self.log_file,
                                        stdin=PIPE)
MattDMo
  • 100,794
  • 21
  • 241
  • 231
Pac
  • 11
  • 1
  • Please add a [mre]. – MattDMo Dec 10 '20 at 15:33
  • Are you sure that you downloaded the chromedriver from https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_mac64.zip ? – supputuri Dec 10 '20 at 15:40
  • I installed using home brew. Current version listed below: oldmac$ chromedriver -v ChromeDriver 87.0.4280.20 (c99e81631faa0b2a448e658c0dbd8311fb04ddbd-refs/branch-heads/4280@{#355}) – Pac Dec 10 '20 at 16:02

0 Answers0