Chromedriver can’t be opened because Apple cannot check it for malicious software

Viewed 3997

Environment:
OS : Big Sur 11.1
Homebrew 3.2.13
Python 3.9.7

Command:
chromedriver —version

Error GUI Alert:
enter image description here

Error via output of .py file attempt to run chromedriver:
raise WebDriverException(selenium.common.exceptions.WebDriverException: Message: Service /opt/homebrew/bin/chromedriver unexpectedly exited. Status code was: -9


Fix Method (1)

As stated in the alert, try updating chromedriver:

Uninstall the current version:
brew uninstall chromedriver

Verify that chromedriver is uninstalled:
brew info chromedriver

Install the newest version of chromedriver:
brew install chromedriver

You can also try:
brew reinstall chromedriver

Fix Method (2) : Still Stuck

If you are still experiencing the issue, this fix helped me.

Determine which chromedriver is being used, run:
which chromedriver

Result :
/opt/homebrew/bin/chromedriver

Use the path to chromedriver in the following command to unblock it.
xattr -d com.apple.quarantine /opt/homebrew/bin/chromedriver

Now run the following:
chromedriver —version

Result : ChromeDriver 93.0.4577.63

Chromedriver should successfully execute.

Reference
coorasse's answer.

2 Answers

For downloading from the chrome drive website this one worked for me for MAC m1 chip

Use the path to chromedriver in the following command to unblock it.

xattr -d com.apple.quarantine path/to/chromedrive

I had the same issue this morning, this is what fixed it for me.

  1. Go to the system and preferences -> security and privacy.
  2. Then under general tab you will see a notification that about the exec you are trying to open.
  3. Just click "open anyway" there.
  4. Go back to the chromedriver exe and open it it will then give you the same error but along with that you will get an option to open it.
  5. Click Open and it should resolve.

Worked for me.

Related